-
Notifications
You must be signed in to change notification settings - Fork 1
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
Allow toggles to work on elements with existing behavior #39
Comments
I think the complete set defined in HTML with activation behavior is |
It makes sense to me that the behavior of a link or form-submission would take precedence over a toggle. But it's not clear to me why otherwise we should restrict toggles from being used on these elements. In particular, I would expect we want people to primarily use toggles on non-submit buttons. |
For what it's worth, when I implemented this in Chromium, I reused logic from the That logic ( Speaking of that... I wouldn't want a click inside a But maybe we should have a distinction between things with activation behavior that are the element with |
(Though maybe activating something inside an element precludes activating the ancestor element by the same action.) |
Yeah my main concern was that links and buttons attached to forms shouldn't be toggleable, since then it's unclear which wins (or both). But a plain button without implicit form behavior should definitely work, and I need to figure out how to tweak the wording accordingly.
Ah, indeed, I'll need to be more precise with the wording about activation targets. |
I somewhat relaxed the restriction in the Chromium implementation in https://chromium-review.googlesource.com/c/chromium/src/+/3996338 . |
The behavior dbaron is referring to is to essentially copy what This makes a lot of sense, tho it's somewhat tangential to the core issue in this thread. #43 is more germane, so let's move discussion on this point (activatable descendants) over there. |
Another related question is whether a descendant with |
The current toggle-trigger production says:
I'm not sure how clearly defined the term 'activation behavior' is, but it seems to imply that toggles can't be applied to
button
elements.I believe that's a mistake, and should be clarified. But I'm also curious how strict we need to be here. For example, the proposed popup spec allows popup behavior on any element, including those with existing behavior - but the existing actions (e.g. form submission) take priority. It seems like the toggle spec could take a similar approach?
/cc @dbaron who initially pointed this out.
The text was updated successfully, but these errors were encountered: