File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ export default class Combobox {
1515 list . id = `combobox-${ Math . random ( ) . toString ( ) . slice ( 2 , 6 ) } `
1616 }
1717
18- this . keyboardEventHandler = event => keyboardBindings ( event , this )
18+ const isMacintosh = / M a c i n t o s h / . test ( navigator . userAgent )
19+
20+ this . keyboardEventHandler = event => keyboardBindings ( event , this , isMacintosh )
1921 this . compositionEventHandler = event => trackComposition ( event , this )
2022 this . inputHandler = this . clearSelection . bind ( this )
2123 input . setAttribute ( 'role' , 'combobox' )
@@ -93,9 +95,7 @@ export default class Combobox {
9395 }
9496}
9597
96- function keyboardBindings ( event : KeyboardEvent , combobox : Combobox ) {
97- const ctrlBindings = ! ! navigator . userAgent . match ( / M a c i n t o s h / )
98-
98+ function keyboardBindings ( event : KeyboardEvent , combobox : Combobox , ctrlBindings : boolean ) {
9999 if ( event . shiftKey || event . metaKey || event . altKey ) return
100100 if ( ! ctrlBindings && event . ctrlKey ) return
101101 if ( combobox . isComposing ) return
You can’t perform that action at this time.
0 commit comments