-
-
Notifications
You must be signed in to change notification settings - Fork 936
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
button click not disabled on within fieldset #1353
Comments
I see. Looks like something a bit fiddly to fix. Interested to see if any framework with event delegation has solved this and how they went about doing so. |
I came across this working on making a port of headlessui. And there they have temporarily solved it by going up the DOM tree looking for a fieldset. |
you can bind native events directly to the element, use <button on:click={() => alert("clicked")}>
click me here and <span style={{ color: "green" }}>good</span>
</button> 🚩 the headlessui fix posted, does not cover nested fieldsets case, see playground |
This issue seems to be fixed? I could not reproduce it anymore. |
Me neither.. But we didn't change anything to my knowledge. I don't see it in the latest Chrome or Firefox. But still seems to be in Safari. Is it the browser behavior that changed? |
Describe the bug
click not disabled when wrapping button in fieldset
This is the same issue as #7711 in react
Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-jeskz7?file=src/App.tsx
Steps to Reproduce the Bug or Issue
Go to the stackblitz
Try to click the button both on the gray and red text
That'll show that clicking directly on the button doesn't trigger the onClick, while clicking on the child element will.
Expected behavior
Clicking on anything within the button should not trigger the onClick handler on the button if the fieldset is set to disabled.
Screenshots or Videos
No response
Platform
Additional context
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-disabled
The text was updated successfully, but these errors were encountered: