{"record":{"id":"41f6354bdf5effa4","repo":"Meituan-Dianping/mpvue","slug":"use-contextmenu-instead-of-click-right-since-r","errorCode":null,"errorMessage":"Use \"contextmenu\" instead of \"click.right\" since right clicks do not actually fire \"click\" events.","messagePattern":"Use \"contextmenu\" instead of \"click\\.right\" since right clicks do not actually fire \"click\" events\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/weex-template-compiler/build.js","lineNumber":2096,"sourceCode":"  left: genGuard(\"'button' in $event && $event.button !== 0\"),\n  middle: genGuard(\"'button' in $event && $event.button !== 1\"),\n  right: genGuard(\"'button' in $event && $event.button !== 2\")\n};\n\nfunction genHandlers (\n  events,\n  isNative,\n  warn\n) {\n  var res = isNative ? 'nativeOn:{' : 'on:{';\n  for (var name in events) {\n    var handler = events[name];\n    // #5330: warn click.right, since right clicks do not actually fire click events.\n    if (process.env.NODE_ENV !== 'production' &&\n      name === 'click' &&\n      handler && handler.modifiers && handler.modifiers.right\n    ) {\n      warn(\n        \"Use \\\"contextmenu\\\" instead of \\\"click.right\\\" since right clicks \" +\n        \"do not actually fire \\\"click\\\" events.\"\n      );\n    }\n    res += \"\\\"\" + name + \"\\\":\" + (genHandler(name, handler)) + \",\";\n  }\n  return res.slice(0, -1) + '}'\n}\n\nfunction genHandler (\n  name,\n  handler\n) {\n  if (!handler) {\n    return 'function(){}'\n  }\n\n  if (Array.isArray(handler)) {","sourceCodeStart":2078,"sourceCodeEnd":2114,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/packages/weex-template-compiler/build.js#L2078-L2114","documentation":"Dev-only compiler warning from genHandlers: @click.right was used, but browsers do not fire a 'click' event for right mouse buttons, so the generated guard ($event.button !== 2) can never pass. The template should express the intent with the contextmenu event instead.","triggerScenarios":"Thrown at packages/weex-template-compiler/build.js:2096 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace @click.right with @contextmenu","Remember to .prevent on contextmenu if the native menu should be suppressed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}