Skip to content

Conversation

@ealmloff
Copy link
Member

Instead of just preventing the default action for submit events, this PR prevents the default action for all onclick events on desktop under a form

Fixes #3791

@ealmloff ealmloff added bug Something isn't working desktop Suggestions related to the desktop renderer labels Feb 26, 2025
@ealmloff ealmloff requested a review from a team as a code owner February 26, 2025 21:53
@jkelleyrtp
Copy link
Member

Not 100% sure if this is technically "right" though it might not matter.

Buttons in forms are given the type "submit" by default whereas they usually receive "button".

We shouldn't prevent default on buttons in forms with a type="button". However, a button with type="button" has no default behavior so there's nothing to prevent.

This implementation should be fine in that case, but it's something to keep in mind.

@jkelleyrtp jkelleyrtp merged commit ceb1a0e into DioxusLabs:main Feb 27, 2025
17 checks passed
AnteDeliria pushed a commit to AnteDeliria/dioxus that referenced this pull request Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working desktop Suggestions related to the desktop renderer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] onclick event handlers broken within form component etc

2 participants