From eb604529c62e9954305889122f34499ad75b3b45 Mon Sep 17 00:00:00 2001 From: HcySunYang Date: Thu, 25 Oct 2018 01:55:33 +0800 Subject: [PATCH] fix: support modifier combination of click.right + .once (#8492) --- src/compiler/helpers.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/compiler/helpers.js b/src/compiler/helpers.js index 6a7375a308..265b05c039 100644 --- a/src/compiler/helpers.js +++ b/src/compiler/helpers.js @@ -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 @@ -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