Skip to content

Conversation

@mohe2015
Copy link
Contributor

@mohe2015 mohe2015 commented Jun 28, 2025

Closes #3904
See also #3791 (comment)
Related PR #3804

@mohe2015 mohe2015 requested a review from a team as a code owner June 28, 2025 15:32
@jkelleyrtp
Copy link
Member

jkelleyrtp commented Jul 1, 2025

From what I can tell this PR doesn't actually do anything - just inlines the preventsDefault function and then deletes the other line?

Ahhhhh read through the linked issue and then realized what's happening.

There was a logic bug here:

    let form = target.closest("form");
    if (target.tagName === "BUTTON" && (event.type == "submit" || form)) {
      event.preventDefault();
    }

The event handling happens in two phases:

  • A PointerEvent (click)
  • A SubmitEvent

We were cancelling the PointerEvent which then cancelled the submit event.

We should only be cancelling submit events. Click events should still fire.

The PR looks good, thanks for the fix.

@jkelleyrtp jkelleyrtp merged commit e947f5e into DioxusLabs:main Jul 1, 2025
19 checks passed
@mohe2015 mohe2015 deleted the fix-submit branch July 1, 2025 08:13
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.

Submit buttons don't work on windows

2 participants