We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e674174 commit ebbe4adCopy full SHA for ebbe4ad
1 file changed
app/components/select-tree.tsx
@@ -273,10 +273,12 @@ export type SelectTreeProps = {
273
};
274
275
const getFilteredOptions = (options: Tree, value: string) => {
276
+ const rx = new RegExp(`^${value}|\\s${value}`, "i");
277
return value === ""
278
? options
- : (pruneTree(options as HierarchyValue[], (d) =>
279
- d.label.toLowerCase().includes(value.toLowerCase())
+ : (pruneTree(
280
+ options as HierarchyValue[],
281
+ (d) => !!d.label.match(rx)
282
) as Tree);
283
284
0 commit comments