-
-
Notifications
You must be signed in to change notification settings - Fork 681
Should use-v-on-exact ignore the .native modifier? #727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I see the same error when trying to use 'once' modifier: <link @mouseenter.once="addTooltipToDOM" @mouseenter="showTooltip" /> |
Thank you for opening this issue @h0rn3z0r I analysed this problem, and here are more cases I could've think about: Native Elements:<!-- Good -->
<button @click="foo"></button>
<button @click="foo" @click.stop="bar"></button>
<button @click.exact="foo" @click.ctrl="bar"></button>
<button @click.exact="foo" @click.ctrl.exact="bar" @click.ctrl.shift="baz"></button>
<button @click.ctrl.exact="foo" @click.ctrl.shift="bar"></button>
<button @click="foo" @click.stop="bar"></button>
<!-- Bad -->
<button @click="foo" @click.ctrl="bar"></button>
<button @click="foo" @click.ctrl.stop="bar"></button>
<button @click.prevent="foo" @click.ctrl="bar"></button>
<button @click.exact="foo" @click.ctrl="bar" @click.ctrl.shift="baz"></button> Custom Components:<!-- Good -->
<UiButton @click="foo" />
<UiButton @click="foo" @click.native="bar" />
<UiButton @click="foo" @click.native.ctrl="bar" />
<UiButton @click="foo" @click.native.exact="bar" @click.native.ctrl="baz" />
<UiButton @click.native.exact="bar" @click.ctrl.native="baz" />
<UiButton @click.native.ctrl.exact="foo" @click.native.ctrl.shift="bar" />
<UiButton @click.native="foo" @click.native.stop="bar" />
<UiButton @click.native.stop="foo" @click.native.prevent="bar" />
<!-- Bad -->
<UiButton @click="foo" @click.native="bar" @click.ctrl.native="baz" />
<UiButton @click.native.ctrl="foo" @click.native.ctrl.shift="bar" /> So I think we shouldn't introduce blacklist here, but rather whitelist possible scenarios. The rule should warn only about using native events that might overlap each other and that can be fixed by using I'm on it. |
Tell us about your environment
What did you do?
I have a situation where I need to bind to a component's change event along with a native change event.
The code looks something like this.
What did you expect to happen?
No error. I don't think the .exact modifier should be necessary here.
What actually happened?
The text was updated successfully, but these errors were encountered: