Skip to content

Commit 1302c29

Browse files
authored
Tree navigation by key: Fix matching to only consider keys with length 1 (#7580)
2 parents cee85cb + 9ecc940 commit 1302c29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/components/src/components/tree/component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class KolTreeWc implements TreeAPI {
172172
event.preventDefault();
173173
break;
174174
}
175-
case event.key.match(/[a-zA-Z0-9]/)?.input: {
175+
case event.key.match(/^[a-zA-Z0-9]$/)?.input: {
176176
/* Ignore events with any modifier key to avoid breaking native browser or OS shortcuts such as ⌘+L */
177177
if (!hasModifierKeyPressed) {
178178
const char = event.key.toLowerCase();

0 commit comments

Comments
 (0)