Skip to content

Commit

Permalink
fix: fix v-close-popper to function on mousedown (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
kouts authored Jan 17, 2024
1 parent 0de649a commit f67c077
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/floating-vue/src/directives/v-close-popper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { supportsPassive } from '../util/env'

function addListeners (el) {
el.addEventListener('click', onClick)
el.addEventListener('mousedown', onMouseDown)
el.addEventListener('touchstart', onTouchStart, supportsPassive
? {
passive: true,
Expand All @@ -10,13 +10,13 @@ function addListeners (el) {
}

function removeListeners (el) {
el.removeEventListener('click', onClick)
el.removeEventListener('mousedown', onMouseDown)
el.removeEventListener('touchstart', onTouchStart)
el.removeEventListener('touchend', onTouchEnd)
el.removeEventListener('touchcancel', onTouchCancel)
}

function onClick (event) {
function onMouseDown (event) {
const el = event.currentTarget
event.closePopover = !el.$_vclosepopover_touch
event.closeAllPopover = el.$_closePopoverModifiers && !!el.$_closePopoverModifiers.all
Expand Down

0 comments on commit f67c077

Please sign in to comment.