Skip to content

Commit 8443e92

Browse files
authored
Merge pull request #13658 from ethereum/fix-query-selector
Fix regex to match only numbers
2 parents ece1544 + 824bba9 commit 8443e92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Nav/Menu/useNavMenu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const useNavMenu = (sections: NavSections) => {
1818

1919
// Focus corresponding nav section when number keys pressed
2020
useEventListener("keydown", (event) => {
21-
if (!document || !event.key.match(/[1-9]/) || isModified(event)) return
21+
if (!document || !event.key.match(/^[1-9]$/) || isModified(event)) return
2222
if (event.target instanceof HTMLInputElement) return
2323
if (event.target instanceof HTMLTextAreaElement) return
2424
if (event.target instanceof HTMLSelectElement) return

0 commit comments

Comments
 (0)