File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -247,11 +247,21 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> {
247
247
break ;
248
248
}
249
249
250
+ // Attempt to use the `event.key` which also maps it to the user's keyboard language,
251
+ // otherwise fall back to resolving alphanumeric characters via the keyCode.
252
+ if ( event . key && event . key . length === 1 ) {
253
+ this . _letterKeyStream . next ( event . key . toLocaleUpperCase ( ) ) ;
254
+ } else if ( ( keyCode >= A && keyCode <= Z ) || ( keyCode >= ZERO && keyCode <= NINE ) ) {
255
+ this . _letterKeyStream . next ( String . fromCharCode ( keyCode ) ) ;
256
+ }
257
+
250
258
// NB: return here, in order to avoid preventing the default action of non-navigational
251
259
// keys or resetting the buffer of pressed letters.
252
260
return ;
253
261
}
254
262
263
+ // Reset the typeahead since the user has used a navigational key.
264
+ this . _pressedLetters = [ ] ;
255
265
event . preventDefault ( ) ;
256
266
}
257
267
You can’t perform that action at this time.
0 commit comments