diff --git a/src/components/PluginSettings/components/SettingNumericComponent.tsx b/src/components/PluginSettings/components/SettingNumericComponent.tsx index 12e8e3600..446d2504b 100644 --- a/src/components/PluginSettings/components/SettingNumericComponent.tsx +++ b/src/components/PluginSettings/components/SettingNumericComponent.tsx @@ -38,9 +38,12 @@ export function SettingNumericComponent({ option, pluginSettings, definedSetting function handleChange(newValue) { const isValid = option.isValid?.call(definedSettings, newValue) ?? true; + + setError(null); if (typeof isValid === "string") setError(isValid); else if (!isValid) setError("Invalid input provided."); - else if (option.type === OptionType.NUMBER && BigInt(newValue) >= MAX_SAFE_NUMBER) { + + if (option.type === OptionType.NUMBER && BigInt(newValue) >= MAX_SAFE_NUMBER) { setState(`${Number.MAX_SAFE_INTEGER}`); onChange(serialize(newValue)); } else { diff --git a/src/components/PluginSettings/components/SettingSelectComponent.tsx b/src/components/PluginSettings/components/SettingSelectComponent.tsx index 164a29a4c..97c17071b 100644 --- a/src/components/PluginSettings/components/SettingSelectComponent.tsx +++ b/src/components/PluginSettings/components/SettingSelectComponent.tsx @@ -36,6 +36,7 @@ export function SettingSelectComponent({ option, pluginSettings, definedSettings if (typeof isValid === "string") setError(isValid); else if (!isValid) setError("Invalid input provided."); else { + setError(null); setState(newValue); onChange(newValue); } diff --git a/src/components/PluginSettings/components/SettingTextComponent.tsx b/src/components/PluginSettings/components/SettingTextComponent.tsx index 599593faf..9eccb10f2 100644 --- a/src/components/PluginSettings/components/SettingTextComponent.tsx +++ b/src/components/PluginSettings/components/SettingTextComponent.tsx @@ -34,6 +34,7 @@ export function SettingTextComponent({ option, pluginSettings, definedSettings, if (typeof isValid === "string") setError(isValid); else if (!isValid) setError("Invalid input provided."); else { + setError(null); setState(newValue); onChange(newValue); }