1
0
Fork 0
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:
LP B 2022-12-15 17:49:36 +01:00 committed by GitHub
parent 67d3abcc9d
commit 68975620c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 146 additions and 3 deletions

View file

@ -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',
]);