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 1
- const ctrlBindings = ! ! navigator . userAgent . match ( / M a c i n t o s h / )
2
-
3
1
export default class Combobox {
4
2
isComposing : boolean
5
3
list : HTMLElement
@@ -17,7 +15,9 @@ export default class Combobox {
17
15
list . id = `combobox-${ Math . random ( ) . toString ( ) . slice ( 2 , 6 ) } `
18
16
}
19
17
20
- this . keyboardEventHandler = event => keyboardBindings ( event , this )
18
+ const ctrlBindings = ! ! navigator . userAgent . match ( / M a c i n t o s h / )
19
+
20
+ this . keyboardEventHandler = event => keyboardBindings ( event , this , ctrlBindings )
21
21
this . compositionEventHandler = event => trackComposition ( event , this )
22
22
this . inputHandler = this . clearSelection . bind ( this )
23
23
input . setAttribute ( 'role' , 'combobox' )
@@ -95,7 +95,7 @@ export default class Combobox {
95
95
}
96
96
}
97
97
98
- function keyboardBindings ( event : KeyboardEvent , combobox : Combobox ) {
98
+ function keyboardBindings ( event : KeyboardEvent , combobox : Combobox , ctrlBindings : boolean ) {
99
99
if ( event . shiftKey || event . metaKey || event . altKey ) return
100
100
if ( ! ctrlBindings && event . ctrlKey ) return
101
101
if ( combobox . isComposing ) return
You can’t perform that action at this time.
0 commit comments