Skip to content

Commit

Permalink
fix(datepicker): Focusable elements in calendarFooter slot
Browse files Browse the repository at this point in the history
  • Loading branch information
mst101 committed Jan 18, 2022
1 parent 52ad18a commit fbc3b46
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/mixins/navMixin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ export default {
}
return null
},
/**
* Returns an array of all HTML elements which should be focus-trapped in the calendarFooter slot
* @returns {Array} An array of HTML elements
*/
getElementsFromCalendarFooter() {
const footerSlotIndex = this.hasSlot('beforeCalendarHeader') ? 2 : 1
return this.getFocusableElements(
this.$refs.view.children[footerSlotIndex],
)
},
/**
* Returns an array of all HTML elements which should be focus-trapped in the specified slot
* @returns {Array} An array of HTML elements
Expand All @@ -157,7 +168,7 @@ export default {
}
if (slotName === 'calendarFooter') {
return this.getFocusableElements(this.$refs.view.children[2])
return this.getElementsFromCalendarFooter()
}
const isBeforeHeader = slotName.indexOf('beforeCalendarHeader') > -1
Expand Down

0 comments on commit fbc3b46

Please sign in to comment.