Skip to content

Commit 0760e27

Browse files
committed
fix search in Dropdown when autoComplete is used
1 parent be2ade3 commit 0760e27

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@ensembleui/react-kitchen-sink": patch
3+
"@ensembleui/react-runtime": patch
4+
---
5+
6+
fix search in Dropdown when autoComplete is used

apps/kitchen-sink/src/ensemble/screens/widgets.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,9 @@ View:
847847
fontSize: 20px
848848
items:
849849
- label: Option 1
850-
value: option1
850+
value: "1234"
851851
- label: Option 2
852-
value: option2
852+
value: "5678"
853853
- Dropdown:
854854
value: 11
855855
label: With item template

packages/runtime/src/widgets/Form/Checkbox.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
unwrapWidget,
66
useRegisterBindings,
77
} from "@ensembleui/react-framework";
8-
import { isString } from "lodash-es";
8+
import { cloneDeep, isString } from "lodash-es";
99
import type { EnsembleWidgetProps } from "../../shared/types";
1010
import { EnsembleRuntime } from "../../runtime";
1111
import { WidgetRegistry } from "../../registry";
@@ -39,7 +39,9 @@ export const CheckboxWidget: React.FC<CheckBoxProps> = (props) => {
3939
return values.trailingText;
4040
}
4141

42-
return EnsembleRuntime.render([unwrapWidget(values.trailingText)]);
42+
return EnsembleRuntime.render([
43+
unwrapWidget(cloneDeep(values.trailingText)),
44+
]);
4345
}
4446
}, [values?.trailingText]);
4547

packages/runtime/src/widgets/Form/Dropdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ const Dropdown: React.FC<DropdownProps> = (props) => {
436436
""
437437
)
438438
}
439+
optionFilterProp="children"
439440
showSearch={
440441
Boolean(values?.autoComplete) ||
441442
Boolean(values?.allowCreateOptions)

0 commit comments

Comments
 (0)