env variables view: scroll only when form is dirty

This commit is contained in:
Anoop M D 2024-09-15 23:59:49 +05:30
parent 1057f54f2f
commit e680d0d71d

View File

@ -87,8 +87,10 @@ const EnvironmentVariables = ({ environment, collection, setIsModified, original
};
useEffect(() => {
if (formik.dirty) {
addButtonRef.current?.scrollIntoView({ behavior: 'smooth' });
}, [formik.values]);
}
}, [formik.values, formik.dirty]);
const handleReset = () => {
formik.resetForm({ originalEnvironmentVariables });