Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

have mutual exclusive feature when change in range input's number field

Forhad Hosain4a7176061369
diff --git a/packages/app/src/builder-ui/ui/form/fields/index.ts b/packages/app/src/builder-ui/ui/form/fields/index.ts
index 22de924b..6d2f9515 100644
--- a/packages/app/src/builder-ui/ui/form/fields/index.ts
+++ b/packages/app/src/builder-ui/ui/form/fields/index.ts
@@ -1534,6 +1534,9 @@ export function createRangeInput({ name, min, max, value, step }: RangeEntry) {
await delay(50);
range.value = elm.value;
+
+ // Dispatch input event on range to trigger mutually exclusive field handlers
+ range.dispatchEvent(new Event('input', { bubbles: true }));
});
// sync the range with number input
@@ -1544,6 +1547,18 @@ export function createRangeInput({ name, min, max, value, step }: RangeEntry) {
await delay(50);
range.value = elm.value;
+
+ // Dispatch input event on range to trigger mutually exclusive field handlers
+ range.dispatchEvent(new Event('input', { bubbles: true }));
+ });
+
+ // sync the range with number input when value is changed directly (e.g., typing and unfocusing)
+ input.addEventListener('change', (event) => {
+ const elm = event.target as HTMLInputElement;
+ range.value = elm.value;
+
+ // Dispatch input event on range to trigger mutually exclusive field handlers
+ range.dispatchEvent(new Event('input', { bubbles: true }));
});
return { rangeInput: range, numberInput: input };