mirror of
https://github.com/portainer/portainer.git
synced 2025-08-08 23:35:31 +02:00
fix(app): cursor jumps to the end of inputs [EE-4359] (#8163)
* feat(app/react): introduce controlled inputs HOC to avoid creating uncontrolled React components * fix(app/env): jumping inputs when adding gpus to existing environment
This commit is contained in:
parent
67d3abcc9d
commit
68975620c5
3 changed files with 146 additions and 3 deletions
|
@ -3,6 +3,7 @@ import angular from 'angular';
|
|||
import { r2a } from '@/react-tools/react2angular';
|
||||
import { CustomTemplatesVariablesDefinitionField } from '@/react/portainer/custom-templates/components/CustomTemplatesVariablesDefinitionField';
|
||||
import { CustomTemplatesVariablesField } from '@/react/portainer/custom-templates/components/CustomTemplatesVariablesField';
|
||||
import { withControlledInput } from '@/react-tools/withControlledInput';
|
||||
|
||||
import { VariablesFieldAngular } from './variables-field';
|
||||
|
||||
|
@ -10,12 +11,16 @@ export const customTemplatesModule = angular
|
|||
.module('portainer.app.react.components.custom-templates', [])
|
||||
.component(
|
||||
'customTemplatesVariablesFieldReact',
|
||||
r2a(CustomTemplatesVariablesField, ['value', 'onChange', 'definitions'])
|
||||
r2a(withControlledInput(CustomTemplatesVariablesField), [
|
||||
'value',
|
||||
'onChange',
|
||||
'definitions',
|
||||
])
|
||||
)
|
||||
.component('customTemplatesVariablesField', VariablesFieldAngular)
|
||||
.component(
|
||||
'customTemplatesVariablesDefinitionField',
|
||||
r2a(CustomTemplatesVariablesDefinitionField, [
|
||||
r2a(withControlledInput(CustomTemplatesVariablesDefinitionField), [
|
||||
'onChange',
|
||||
'value',
|
||||
'errors',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue