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

Icon Button does not trigger form submit event #182

Open
JensRoland opened this issue Feb 10, 2025 · 0 comments
Open

Icon Button does not trigger form submit event #182

JensRoland opened this issue Feb 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@JensRoland
Copy link

JensRoland commented Feb 10, 2025

Describe the bug

<wa-icon-button> does not seem to trigger the form submit event. Adding type="submit" works for <wa-button> but not <wa-icon-button>.

To Reproduce

Steps to reproduce the behavior:

Create a page with the latest WA CSS and JS and insert a simple form:

<h3>Form</h3>
<form action="/delete" method="post" onsubmit="return confirm('Are you sure?');">
    <wa-icon-button name="trash-can" variant="regular" label="Delete"></wa-icon-button>
    <button type="submit">Delete</button>
</form>

If you click the normal 'Delete' button, the confirm prompt appears.

If you click the Icon button, nothing happens.

My workaround is to add onclick="this.parentElement.requestSubmit()" but it would be more intuitive to have the icon button behave the same as the button and wa-button.

Demo

CodePen login was borked so I could not save my Pen. It should only take a moment to reproduce with the code above though.

Screenshots

If applicable, add screenshots to help explain the bug.

Browser / OS

  • OS: Mac OS X Sequoia
  • Browser: Chrome
  • Browser version: 132.0.6834.160

Additional information

Provide any additional information about the bug here.

@JensRoland JensRoland added the bug Something isn't working label Feb 10, 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
Projects
None yet
Development

No branches or pull requests

1 participant