Skip to content

Commit

Permalink
fix: support modifier combination of click.right + .once (#8492)
Browse files Browse the repository at this point in the history
  • Loading branch information
HcySunYang authored and yyx990803 committed Oct 24, 2018
1 parent 002acbe commit eb60452
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/compiler/helpers.js
Expand Up @@ -65,6 +65,18 @@ export function addHandler (
)
}

// normalize click.right and click.middle since they don't actually fire
// this is technically browser-specific, but at least for now browsers are
// the only target envs that have right/middle clicks.
if (name === 'click') {
if (modifiers.right) {
name = 'contextmenu'
delete modifiers.right
} else if (modifiers.middle) {
name = 'mouseup'
}
}

// check capture modifier
if (modifiers.capture) {
delete modifiers.capture
Expand All @@ -80,18 +92,6 @@ export function addHandler (
name = '&' + name // mark the event as passive
}

// normalize click.right and click.middle since they don't actually fire
// this is technically browser-specific, but at least for now browsers are
// the only target envs that have right/middle clicks.
if (name === 'click') {
if (modifiers.right) {
name = 'contextmenu'
delete modifiers.right
} else if (modifiers.middle) {
name = 'mouseup'
}
}

let events
if (modifiers.native) {
delete modifiers.native
Expand Down

0 comments on commit eb60452

Please sign in to comment.