1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-10 00:05:24 +02:00

fix(nameField): imperatively call setDebouncedValue when the value is changed by setFieldValue [EE-5002] (#8468)

Co-authored-by: testa113 <testa113>
This commit is contained in:
Ali 2023-02-13 15:06:14 +13:00 committed by GitHub
parent cef9255161
commit 5c05ec489e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View file

@ -1,6 +1,6 @@
import { useField } from 'formik';
import { string } from 'yup';
import { useRef } from 'react';
import { useRef, useEffect } from 'react';
import { getEnvironments } from '@/react/portainer/environments/environment.service';
import { useDebounce } from '@/react/hooks/useDebounce';
@ -25,6 +25,10 @@ export function NameField({
const [debouncedValue, setDebouncedValue] = useDebounce(value, setValue);
useEffect(() => {
setDebouncedValue(value);
}, [setDebouncedValue, value]);
return (
<FormControl
label="Name"