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 @@ -243,11 +243,21 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> {
243243 break ;
244244 }
245245
246+ // Attempt to use the `event.key` which also maps it to the user's keyboard language,
247+ // otherwise fall back to resolving alphanumeric characters via the keyCode.
248+ if ( event . key && event . key . length === 1 ) {
249+ this . _letterKeyStream . next ( event . key . toLocaleUpperCase ( ) ) ;
250+ } else if ( ( keyCode >= A && keyCode <= Z ) || ( keyCode >= ZERO && keyCode <= NINE ) ) {
251+ this . _letterKeyStream . next ( String . fromCharCode ( keyCode ) ) ;
252+ }
253+
246254 // NB: return here, in order to avoid preventing the default action of non-navigational
247255 // keys or resetting the buffer of pressed letters.
248256 return ;
249257 }
250258
259+ // Reset the typeahead since the user has used a navigational key.
260+ this . _pressedLetters = [ ] ;
251261 event . preventDefault ( ) ;
252262 }
253263
You can’t perform that action at this time.
0 commit comments