-
Notifications
You must be signed in to change notification settings - Fork 197
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
[invokers] Implicit targets #1057
Comments
seems like a good idea worth considering for those contexts. |
Replying to @mfreed7 here instead (whatwg/html#9625 (comment))
Implicit relationships are normal in HTML: form controls with a Explicit-only relationship include |
I think this would be very useful for https://ant-design.antgroup.com/components/collapse-cn#components-collapse-demo-collapsible <details>
<summary>Summary Title
<button invokeaction="open">Toggle</button>
</summary>
Something small enough to escape casual notice.
</details> Also, how do we disable the default behavior of the |
@yisibl invokers currently don't work for |
Currently invoketarget works in Chrome (with flag turned on) Demo: https://codepen.io/yisi/pen/MWdbBrP <details id="foo">
<summary>Summary Title
<button invoketarget="foo">Toggle</button>
</summary>
Something small enough to escape casual notice.
</details> |
To clarify it's part of the prototype implementation (it's a separate runtime flag even) but invokers V1 will only include dialog, popover and custom actions. |
Yeah, fair enough. I wonder if there might be ambiguities in case there are multiple nested elements to which a single value of the @keithamus any objections to trying to add that capability? Seems relatively straightforward, at least implementation-wise.
+1 that because of whatwg/html#2272 we probably shouldn't try too hard to add this capability for |
Fwiw I think after discussions invokers probably won't be added for details, I envisage the stylability improvements will address most of the use cases and the a11y story with details + invokers isn't clear (they might be actively detrimental which I want to avoid). With all that being said that's tangential. If they are supported they would benefit from this ability. I think for the ambiguous actions case as you say it would just be walking up the (flat?) tree to find the relevant target, Closest parent wins sort of algorithm. |
Simon's point about buttons in vs out of a form makes a lot of sense to me. If we re-imagine a submit button as just being a type of invoker (which they effectively are), implicit targets suddenly seem obvious. e.g. Now I'm not saying we should re-invent submit as an invoke action, I think reset and submit the ship has long sailed on. But from an API design perspective the symmetry is nice. |
I agree with everything @lukewarlow said. Seems trivial to add and has a nice value add. In whether or not it should traverse the flat tree, my vote is flat. |
There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label. |
Going to go ahead and close this for now based on discussions in whatwg it seems we've decided to go with explicit command and targets at least initially. |
Came up from Simon whatwg/html#9625 (comment)
Seems plausible to do.
TLDR: If the button is in a dialog or popover and has an non-ambiguous action value then we don't need an ID ref.
The text was updated successfully, but these errors were encountered: