File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
app/code/Magento/AdminAnalytics/view/adminhtml/web/js/modal Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -130,31 +130,39 @@ define([
130
130
* so the user must select an option to dismiss the modal
131
131
*/
132
132
handleTabKey : function ( event ) {
133
- var modal = this ;
134
- var KEY_TAB = 9 ;
133
+ var modal = this ,
134
+ KEY_TAB = 9 ;
135
135
136
+ /**
137
+ * Handle Shift+Tab to tab backwards
138
+ */
136
139
function handleBackwardTab ( ) {
137
- if ( document . activeElement === modal . firstFocusableElement
138
- || document . activeElement === $ ( modal . rootSelector ) [ 0 ]
140
+ if ( document . activeElement === modal . firstFocusableElement ||
141
+ document . activeElement === $ ( modal . rootSelector ) [ 0 ]
139
142
) {
140
143
event . preventDefault ( ) ;
141
144
modal . lastFocusableElement . focus ( ) ;
142
145
}
143
146
}
147
+
148
+ /**
149
+ * Handle Tab forward
150
+ */
144
151
function handleForwardTab ( ) {
145
- if ( document . activeElement === modal . lastFocusableElement ) {
152
+ if ( document . activeElement === modal . lastFocusableElement ) {
146
153
event . preventDefault ( ) ;
147
154
modal . firstFocusableElement . focus ( ) ;
148
155
}
149
156
}
150
157
151
- switch ( event . keyCode ) {
158
+ switch ( event . keyCode ) {
152
159
case KEY_TAB :
153
- if ( modal . focusableElements . length === 1 ) {
160
+ if ( modal . focusableElements . length === 1 ) {
154
161
event . preventDefault ( ) ;
155
162
break ;
156
163
}
157
- if ( event . shiftKey ) {
164
+
165
+ if ( event . shiftKey ) {
158
166
handleBackwardTab ( ) ;
159
167
break ;
160
168
}
You can’t perform that action at this time.
0 commit comments