fix(InputMenu/SelectMenu): escape regexp before search

This commit is contained in:
Benjamin Canac
2024-10-10 16:12:22 +02:00
parent 0f9ac8733e
commit 7c21ddefa8
3 changed files with 12 additions and 6 deletions

View File

@@ -59,3 +59,7 @@ export function looseToNumber(val: any): any {
const n = Number.parseFloat(val)
return Number.isNaN(n) ? val : n
}
export function escapeRegExp(string: string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
}