This commit is contained in:
James
2022-11-15 09:20:54 -05:00
parent f938dd718f
commit 50bcf001ea

View File

@@ -38,7 +38,11 @@ const useField = <T extends unknown>(options: Options): FieldType<T> => {
if (!modified && !disableModifyingForm) {
if (typeof setModified === 'function') {
Promise.resolve(() => setModified(true))
// Update modified state after field value comes back
// to avoid cursor jump caused by state value / DOM mismatch
setTimeout(() => {
setModified(true);
}, 10);
}
}