Skip to content
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

@submit.once.prevent / @submit.prevent.once - Not working as expected #10039

Closed
reed-jones opened this issue May 16, 2019 · 1 comment
Closed

Comments

@reed-jones
Copy link

Version

2.6.10

Reproduction link

https://codesandbox.io/s/vue-template-yfmeh

Steps to reproduce

Create a <form /> with and @submit handler. using either the .prevent and .once handlers work as expected, however in combination it seems to prevent default the first time, but not prevent default the second time resulting in a page refresh.

What is expected?

the form to be submitted only once with no page refresh/reload

What is actually happening?

the form submits correctly the first time, but on the second click it causes a page reload

@posva
Copy link
Member

posva commented May 16, 2019

this is expected once will add only the event listener once. Use two event listeners if you want to always prevent default @submit.prevent @submit.prevent.once="..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants