Open lukewarlow opened 1 year ago
The Open UI Community Group just discussed [interesttarget] Can we add interesttarget support to more elements
.
The Open UI Community Group just discussed [interesttarget] Can we add interesttarget support to more elements
, and agreed to the following:
RESOLVED: support interesttarget on buttons (<input type=button> or <button>) and links (<a>) only, and explore expanding to other element types in the future.
To clarify is there a specific reason against <area>
?
See https://github.com/openui/open-ui/issues/857 for a request for interest support on abbr elements.
Just while I remember I thought I'd note it down one use case for interesttarget (at least the focus aspect) on inputs in general is the <input list="foo">
type scenario where you want to be able to trigger a popover of suggestions while focused on an input. Though potentially this is better off being a platform editable combobox type setup and we don't expose the capability beyond that at least initially.
Much the same way that selectlist will have focusgroup behaviour (afaik) but we don't expose focusgroup yet.
Could interestTarget
be used to provide a declarative option for some JavaScript APIs? I'm thinking specifcally of JavaScript APIs that require a user interaction (and so most demos involve the creation of a button element anyway) and that don't currently have an equivalent HTML element.
For example:
For that last one, the default behaviour could be sharing the current URL. I've been collecting use cases to inform a proposal for button type="share"
but button interestarget="share"
would achieve the same goal.
Likewise, button interesttartget="requestfullscreen"
and button interesttarget="exitfullscreen
could be directly equivalent to document.requestfullscreen
and document.exitfullscreen
but without the need to create a button with JavaScript (or write any JavaScript at all).
I'm not sure how the button interesttarget="geolocation"
would work other than perhaps populating an input
element using invoketarget
.
I realise that this issue was asking specifically for HTML elements, not JavaScript APIs, so I apologize if this is off-topic.
@adactio could you open a new issue for that discussion?
Fwiw it would be invoketarget rather than interesttarget (click vs hover), also fullscreen API is already included! Glad to get validation that others believe that would be useful!
@lukewarlow Done!
https://github.com/openui/open-ui/issues/972
I didn't realise that the fullscreen API was already included—that bodes very well!
<input type=range>
absolutely need it! Typically used to display a tooltip.
Another thought is something like an input type file where it is at its core a button. We support buttons should we allow hovering and focus triggering for a file input? It'd almost be good if there was some way to target the file-selector-button part but obviously can't do that with attributes.
When this gets revisited, ensuring we can support #elementinternal.role="button"
or event just role="button"
content would be amazing!!
If I didn't think it would take forever, I'd say this was a great place for the browser to start shipping element behaviors that custom element developers could leverage to be a more natural part of the larger web platform...
Yes, instead of trying to predetermine the canonical list of things that may sometimes behave similarly to buttons, being able to provide a role for interoperability between things like <x-button>
and popovertarget
would be elegant & powerful.
When this gets revisited, ensuring we can support
#elementinternal.role="button"
or event justrole="button"
content would be amazing!!
I believe the HTML spec takes an architectural hard line that aria roles and attributes should not impact HTML features, and should only be used to map to accessibility information.
correct @keithamus. ARIA is not meant to have any functional or styling impact on HTML at all. merely a way to change the way an element is exposed to the a11y tree.
that said, i do think it'd make sense for this to work on custom elements that have been properly setup via element internals. but div role=button
is still just a div at its core.
correct @keithamus. ARIA is not meant to have any functional or styling impact on HTML at all. merely a way to change the way an element is exposed to the a11y tree.
that said, i do think it'd make sense for this to work on custom elements that have been properly setup via element internals. but
div role=button
is still just a div at its core.
Huge +1 for custom element support via ElementInternals.
I think that tabindex=0
should also be supported since I've seen sites have tooltips on elements which aren't buttons.
Or if not, then abbr
could have it supported instead. Since this element is meant to use the title
attribute for its expanded abbreviation, however, title
isn't accessible to most browsers.
See https://github.com/keithamus/invoker-buttons-proposal/issues/14 for more details and that repo in general for full details.
TLDR:
interesttarget
attribute currently proposed to be supported on buttons and links. Could we add support to<area>
,<input>
,<textarea>
,<select>
,<summary>
. (selectlist
in future would be on this list) along with potentially other elements?Are there extra elements we can/should add this too?