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> {
247247 break ;
248248 }
249249
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+
250258 // NB: return here, in order to avoid preventing the default action of non-navigational
251259 // keys or resetting the buffer of pressed letters.
252260 return ;
253261 }
254262
263+ // Reset the typeahead since the user has used a navigational key.
264+ this . _pressedLetters = [ ] ;
255265 event . preventDefault ( ) ;
256266 }
257267
You can’t perform that action at this time.
0 commit comments