Skip to content

Commit b46ab2b

Browse files
committed
Handle 'touchstart'
1 parent b3ebd69 commit b46ab2b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/components/dropdown/dropdown.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export const BDropdown = /*#__PURE__*/ Vue.extend({
172172
},
173173
on: {
174174
mousedown: this.onMousedown,
175+
touchstart: this.onMousedown,
175176
click: this.toggle,
176177
keydown: this.toggle // Handle ENTER, SPACE and DOWN
177178
}

src/components/nav/nav-item-dropdown.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export const BNavItemDropdown = /*#__PURE__*/ Vue.extend({
5555
},
5656
on: {
5757
mousedown: this.onMousedown,
58+
touchstart: this.onMousedown,
5859
click: this.toggle,
5960
keydown: this.toggle // Handle ENTER, SPACE and DOWN
6061
}

src/mixins/dropdown.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,10 @@ export default {
346346
this.show()
347347
}
348348
},
349-
// Mousedown handler for the toggle
349+
// Mousedown/Touchstart handler for the toggle
350350
onMousedown(evt) {
351-
// We prevent the 'mousedown' event for the toggle to stop the
352-
// 'focusin' event from being fired
351+
// We prevent the 'mousedown'/'touchstart' event for the toggle
352+
// to stop the 'focusin' event from being fired
353353
// The event would otherwise be picked up by the global 'focusin'
354354
// listener and there is no cross-browser solution to detect it
355355
// relates to the toggle click

0 commit comments

Comments
 (0)