From 239f355112cd0b0cb784933890d008bcb832b486 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 17 Jun 2026 17:22:40 +0200 Subject: [PATCH] fix: reset animation fps limit to native when field is cleared on blur MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a user entered a custom fps limit (e.g. 60), then cleared the field and clicked away, the setting was not updated — the field stayed empty and the 'native' button remained inactive. Root cause: the onBlur validator called form.handleSubmit() with an empty value, which failed validation ('Must be a number') and silently did nothing. resetToDefaultIfEmptyOnBlur had no effect because the form's defaultValues.fpsLimit was already "". Fix: detect an empty value in onBlur and explicitly reset to native (fpsLimit = 1000), making the 'native' button go active — which matches the expected behavior described in the issue. Fixes #8119 --- .../pages/settings/custom-setting/AnimationFpsLimit.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/ts/components/pages/settings/custom-setting/AnimationFpsLimit.tsx b/frontend/src/ts/components/pages/settings/custom-setting/AnimationFpsLimit.tsx index c7ad5b19eba3..3230ef9ebf40 100644 --- a/frontend/src/ts/components/pages/settings/custom-setting/AnimationFpsLimit.tsx +++ b/frontend/src/ts/components/pages/settings/custom-setting/AnimationFpsLimit.tsx @@ -62,7 +62,13 @@ export function AnimationFpsLimit(): JSXElement { value: val, }); }, - onBlur: () => { + onBlur: ({ value }) => { + if (String(value) === "") { + setfpsLimit(1000); + form.setFieldValue("fpsLimit", ""); + savedIndicator.hide(); + return; + } void form.handleSubmit(); }, }} @@ -73,7 +79,6 @@ export function AnimationFpsLimit(): JSXElement { placeholder={"custom limit"} type="number" schema={fpsLimitSchema} - resetToDefaultIfEmptyOnBlur />