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

Should popovertarget work on a reset button / input in a form? #10436

Open
lukewarlow opened this issue Jun 26, 2024 · 4 comments
Open

Should popovertarget work on a reset button / input in a form? #10436

lukewarlow opened this issue Jun 26, 2024 · 4 comments
Labels
topic: forms topic: popover The popover attribute and friends

Comments

@lukewarlow
Copy link
Member

What is the issue with the HTML Standard?

Currently the spec says that a reset button should always work to open a popover. This is implemented by Firefox.

Chromium however does not allow popovertarget to work on a reset button/input in a form element.

Safari does not allow it to work on a reset button in a form BUT does on a reset input. This appears to be due to the same bug that prevents explicit type=button buttons from working in a form, so I'm not sure it's deliberate that reset buttons don't work.

https://wpt.live/html/semantics/popovers/button-type-reset-popovertarget.tentative.html - this test also disagrees with the spec.

So TLDR should <form><button type="reset" popovertarget="popover">Reset</button> work?

@annevk annevk added the topic: popover The popover attribute and friends label Jun 26, 2024
@annevk
Copy link
Member

annevk commented Jun 26, 2024

It seems we only make it not work for submit buttons when they have a form owner: https://html.spec.whatwg.org/multipage/popover.html#popover-target-element

But given that image buttons work I don't see why reset buttons shouldn't work. Either we restrict it to plain buttons in some way (which currently don't seem to appear as a concept from a quick scan so unclear if that's good) or we stick with what we have.

@scottaohara
Copy link
Collaborator

if the image button is acting as a submit button though, then popover shouldn't work with it.

Seems like an accident that reset wasn't called out. We had specifically talked about how form actions (submission, but also resetting) should take priority over popover behavior.

@lukewarlow
Copy link
Member Author

if the image button is acting as a submit button though, then popover shouldn't work with it.

Fwiw this seems to be the case across the board, so that bit I think is fine.

@annevk
Copy link
Member

annevk commented Jun 26, 2024

Oops, I missed that image buttons are submit buttons. I suppose we could introduce a reset button concept as well and exclude them in a similar fashion. I kinda wish we didn't have the "form owner" check, but so be it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: forms topic: popover The popover attribute and friends
Development

No branches or pull requests

3 participants