(e)
| 178 | } |
| 179 | |
| 180 | handleTab(e) { |
| 181 | if (e.which !== 9) return; |
| 182 | if (this.offcanvasIndex < Offcanvas.openCount - 1) return; // last opened offcanvas |
| 183 | |
| 184 | const focusableChildren = this.getFocusableChildren(); |
| 185 | const totalFocusable = focusableChildren.length; |
| 186 | if (totalFocusable === 0) return; |
| 187 | const currentFocus = this.getFocusedChild(); |
| 188 | |
| 189 | let focusedIndex = 0; |
| 190 | |
| 191 | for (let i = 0; i < totalFocusable; i += 1) { |
| 192 | if (focusableChildren[i] === currentFocus) { |
| 193 | focusedIndex = i; |
| 194 | break; |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | if (e.shiftKey && focusedIndex === 0) { |
| 199 | e.preventDefault(); |
| 200 | focusableChildren[totalFocusable - 1].focus(); |
| 201 | } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) { |
| 202 | e.preventDefault(); |
| 203 | focusableChildren[0].focus(); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | handleBackdropMouseDown(e) { |
| 208 | this._mouseDownElement = e.target; |
nothing calls this directly
no test coverage detected
searching dependent graphs…