File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -209,17 +209,17 @@ export default {
209
209
return this .getFocusableElements (picker .children [index])
210
210
},
211
211
/**
212
- * Returns an array of all HTML elements which should be focus-trapped in the header
213
- * @returns {Array} An array of HTML elements
212
+ * Returns an array of all HTMLButtonElements which should be focus-trapped in the header
213
+ * @returns {Array} An array of HTMLButtonElements
214
214
*/
215
215
getElementsFromHeader () {
216
- const view = this . ucFirst ( this .view )
217
- const beforeCalendarSlotName = ` beforeCalendarHeader ${ view } `
218
- const picker = this . $refs . picker . $el
219
- const index = this .hasSlot (beforeCalendarSlotName) ? 1 : 0
220
- const fragment = picker . children [index]
216
+ if ( ! this .$refs . picker . $refs . pickerHeader ) {
217
+ return []
218
+ }
219
+ const header = this .$refs . picker . $refs . pickerHeader . $el
220
+ const navNodeList = header . querySelectorAll ( ' button:enabled ' )
221
221
222
- return this . showHeader ? this . getFocusableElements (fragment) : [ ]
222
+ return [ ... Array . prototype . slice . call (navNodeList) ]
223
223
},
224
224
/**
225
225
* Returns an array of focusable elements in a given HTML fragment
You can’t perform that action at this time.
0 commit comments