From 60b4433543723f1f4c54cf236141c7458ade0a81 Mon Sep 17 00:00:00 2001 From: Alisher Musurmonov Date: Fri, 23 Aug 2024 20:01:13 +0500 Subject: [PATCH] fix: `search is not a function` issue (#807) --- lib/utils/filterSelectValues.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/filterSelectValues.js b/lib/utils/filterSelectValues.js index f69a11bd..95def34a 100644 --- a/lib/utils/filterSelectValues.js +++ b/lib/utils/filterSelectValues.js @@ -4,5 +4,5 @@ import { escapeRegExp } from 'lodash'; export const filterSelectValues = (value, dataOptions) => { const regex = new RegExp(escapeRegExp(value), 'i'); - return dataOptions.filter(({ label }) => label.search(regex) !== -1); + return dataOptions.filter(({ label }) => label.search?.(regex) !== -1); };