We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 443b007 commit eecc1caCopy full SHA for eecc1ca
.changeset/poor-pots-speak.md
@@ -0,0 +1,5 @@
1
+---
2
+"@ensembleui/react-runtime": patch
3
4
+
5
+fix: create new option incase of no exact match found
packages/runtime/src/widgets/Form/MultiSelect.tsx
@@ -228,9 +228,8 @@ const MultiSelect: React.FC<MultiSelectProps> = (props) => {
228
setSearchValue(value);
229
return;
230
}
231
- const isOptionExist = options.find(
232
- (option) =>
233
- option.label.toString().toLowerCase().search(value.toLowerCase()) > -1,
+ const isOptionExist = options.some(
+ (option) => option.label.toString().toLowerCase() === value.toLowerCase(),
234
);
235
236
if (!isOptionExist && values?.allowCreateOptions) {
0 commit comments