Vue: @click.prevent also prevents all child elements interactions

Created on 13 Jun 2017  ·  3Comments  ·  Source: vuejs/vue

Version

2.3.3

Reproduction link

https://jsfiddle.net/50wL7mdz/39994/

Steps to reproduce

  1. Click on the link, it will be prevented.
  2. Try to open the input file, it will be prevented too.

What is expected?

The element with @click.prevent will be prevented, child elements with default actions shouldn't be prevented.

What is actually happening?

The element with @click.prevent is prevented, child elements with default actions prevented too.


I want to use elements with default actions inside a parent element that uses @click.prevent. @click.prevent.self doesn't help either.

Most helpful comment

try @click.self.prevent

All 3 comments

try @click.self.prevent

you have to add self before the prevent as @JounQin said

I'm creating a PR for the docs. Thanks for the feedback 🙂

Was this page helpful?
0 / 5 - 0 ratings