Skip to content

Fixed double click submit before next - #1370

Open
indykoning wants to merge 3 commits into
masterfrom
bugfix/double-click-next
Open

Fixed double click submit before next#1370
indykoning wants to merge 3 commits into
masterfrom
bugfix/double-click-next

Conversation

@indykoning

Copy link
Copy Markdown
Member

This fixes a bug where you have to click the next button twice in the checkout.
If you're editing an input and immediately click the "next" button it disables before you actually click. Preventing the trigger to move to the next page in the form.

It does this because every fieldset syncs it's data to Magento on change, during these network requests the "Next" button gets disabled.
If you try to click the "next" button from a changed input it'll:

  1. Trigger the change on the input
  2. Do the network request
  3. Disable the "next" button due to the network request
  4. Trigger the click event on the changed input.

v-on:mousedown.prevent is the solution, why?
mousedown executes in the same event cycle as the change event does, calling prevent on that also prevents the change event from running.
This doesn't work on the click event since click is triggered in a later event cycle.

The reason why missing this change event is no problem is because the click/submit causes all partial-submit fieldsets to first push their value to Magento before proceeding to the next step.
Since the inputs have no v-model.lazy but v-model the data is synced to vue on input, not on change

So all input will get synced to Magento before proceeding.

@indykoning
indykoning requested a review from royduin as a code owner September 3, 2026 07:31
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

Successfully merging this pull request may close these issues.

1 participant