File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,16 @@ function keyboardBindings(event: KeyboardEvent, combobox: Combobox) {
120
120
combobox . navigate ( - 1 )
121
121
event . preventDefault ( )
122
122
break
123
+ case 'Home' :
124
+ combobox . clearSelection ( )
125
+ combobox . navigate ( 1 )
126
+ event . preventDefault ( )
127
+ break
128
+ case 'End' :
129
+ combobox . clearSelection ( )
130
+ combobox . navigate ( - 1 )
131
+ event . preventDefault ( )
132
+ break
123
133
case 'n' :
124
134
if ( ctrlBindings && event . ctrlKey ) {
125
135
combobox . navigate ( 1 )
Original file line number Diff line number Diff line change @@ -138,6 +138,14 @@ describe('combobox-nav', function() {
138
138
assert . equal ( options [ 5 ] . getAttribute ( 'aria-selected' ) , 'true' )
139
139
assert . equal ( input . getAttribute ( 'aria-activedescendant' ) , 'link' )
140
140
141
+ press ( input , 'Home' )
142
+ assert . equal ( options [ 0 ] . getAttribute ( 'aria-selected' ) , 'true' )
143
+ assert . equal ( input . getAttribute ( 'aria-activedescendant' ) , 'baymax' )
144
+
145
+ press ( input , 'End' )
146
+ assert . equal ( options [ 5 ] . getAttribute ( 'aria-selected' ) , 'true' )
147
+ assert . equal ( input . getAttribute ( 'aria-activedescendant' ) , 'link' )
148
+
141
149
press ( input , 'Enter' )
142
150
assert . equal ( expectedTargets . length , 2 )
143
151
assert . equal ( expectedTargets [ 0 ] , 'hubot' )
You can’t perform that action at this time.
0 commit comments