mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-18 22:11:43 +01:00
fix(InputMenu/SelectMenu): escape regexp before search
This commit is contained in:
@@ -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, '\\$&')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user