mirror of
https://github.com/portainer/portainer.git
synced 2025-08-03 04:45:21 +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
|
@ -1,6 +1,7 @@
|
|||
import { array, object, string } from 'yup';
|
||||
|
||||
import { r2a } from '@/react-tools/react2angular';
|
||||
import { withControlledInput } from '@/react-tools/withControlledInput';
|
||||
|
||||
import { InputList } from '@@/form-components/InputList';
|
||||
import { ItemProps } from '@@/form-components/InputList/InputList';
|
||||
|
@ -65,4 +66,7 @@ export function gpusListValidation() {
|
|||
return array().of(gpuShape).default([]);
|
||||
}
|
||||
|
||||
export const GpusListAngular = r2a(GpusList, ['value', 'onChange']);
|
||||
export const GpusListAngular = r2a(withControlledInput(GpusList), [
|
||||
'value',
|
||||
'onChange',
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue