Skip to content

Commit c16644d

Browse files
authored
ARIA - ignore key up/down on form elements
1 parent 5124591 commit c16644d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/mixins/dropdown.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import clickOutMixin from './click-out'
88
import focusInMixin from './focus-in'
99

1010
// Return an Array of visible items
11-
function filterVisible(els) {
11+
function filterVisibles(els) {
1212
return (els || []).filter(isVisible)
1313
}
1414

@@ -189,6 +189,7 @@ export default {
189189

190190
// Are we in a navbar ?
191191
if (isNull(this.inNavbar) && this.isNav) {
192+
// We should use an injection for this
192193
/* istanbul ignore next */
193194
this.inNavbar = Boolean(closest('.navbar', this.$el))
194195
}
@@ -381,7 +382,8 @@ export default {
381382
},
382383
// Keyboard nav
383384
focusNext(evt, up) {
384-
if (!this.visible) {
385+
if (!this.visible || (evt && closest(Selector.FORM_CHILD, evt.target))) {
386+
// Ignore key up/down on form elements
385387
/* istanbul ignore next: should never happen */
386388
return
387389
}
@@ -414,7 +416,7 @@ export default {
414416
},
415417
getItems() {
416418
// Get all items
417-
return filterVisible(selectAll(Selector.ITEM_SELECTOR, this.$refs.menu))
419+
return filterVisibles(selectAll(Selector.ITEM_SELECTOR, this.$refs.menu))
418420
},
419421
focusMenu() {
420422
this.$refs.menu.focus && this.$refs.menu.focus()

0 commit comments

Comments
 (0)