(e)
| 217 | } |
| 218 | |
| 219 | handleTab(e) { |
| 220 | if (e.which !== 9) return; |
| 221 | if (this.modalIndex < Modal.openCount - 1) return; // last opened modal |
| 222 | |
| 223 | const focusableChildren = this.getFocusableChildren(); |
| 224 | const totalFocusable = focusableChildren.length; |
| 225 | if (totalFocusable === 0) return; |
| 226 | const currentFocus = this.getFocusedChild(); |
| 227 | |
| 228 | let focusedIndex = 0; |
| 229 | |
| 230 | for (let i = 0; i < totalFocusable; i += 1) { |
| 231 | if (focusableChildren[i] === currentFocus) { |
| 232 | focusedIndex = i; |
| 233 | break; |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | if (e.shiftKey && focusedIndex === 0) { |
| 238 | e.preventDefault(); |
| 239 | focusableChildren[totalFocusable - 1].focus(); |
| 240 | } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) { |
| 241 | e.preventDefault(); |
| 242 | focusableChildren[0].focus(); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | handleBackdropMouseDown(e) { |
| 247 | this._mouseDownElement = e.target; |
nothing calls this directly
no test coverage detected
searching dependent graphs…