w3c / html-aam

HTML Accessibility API Mappings - new spec updates should be made in https://github.com/w3c/aria/tree/main/html-aam
https://w3c.github.io/html-aam/
Other
100 stars 27 forks source link

popovertargetaction=show/hide when popover is already shown or hidden #505

Open scottaohara opened 1 year ago

scottaohara commented 1 year ago

Thoughts on whether this should be exposed as 'disabled' in the accessibility API - since the button won't actually do anything if the popover is in the state that matches the action value.

YummyBacon5 commented 1 year ago

I think that it should not have disabled. Since wouldn't the state of if the popover's shown or not be conveyed through aria-expanded? Also, if an author has their own aria-disabled on a popovertargetaction button, then this may mess with that.


But on a slightly different topic, if there's a popovertarget button as a child of the same already shown popover, then I think this should be aria-expanded=undefined. Since obviously a popover is already shown if the user is on a close control inside it.

To better understand what I mean:

<div id="p" popover> <!--Popover is shown-->

    <button popovertarget="p">Close</button>
    <button popovertarget="p" popovertargetaction="toggle">Close</button>
    <button popovertarget="p" popovertargetaction="hide">Close</button>
    <!--These all should have `aria-expanded=undefined`-->
</div>
cookiecrook commented 1 year ago

Sounds like this is identical in functionality to <button>foo</button>… It's not disabled, just not doing anything.

smhigley commented 11 months ago

A few real-world use cases that seem like they would be harmed by this come to mind:

I could be misunderstanding how to use popover=hint vs. popovertargetaction, but I can definitely see authors creating an expand-popover target that also has an additional action be something that is more than an edge case.

I'm also generally leery of browsers magically marking a trigger semantically disabled while the author still thinks the trigger is enabled, and while the trigger is enabled for anyone not using a screen reader. I'd rather take the stance that authors are responsible for deciding whether the element is enabled or disabled equally for everyone.

scottaohara commented 11 months ago

unless anyone has any compelling use cases that couldn't arguably be redesigned to mitigate issues of buttons that don't 'do anything', it seems like the answer from today's call was "no" don't automatically do this.

I think from @YummyBacon5's example, the only thing not covered in the current PR (#481) is to potentially set the close 'toggle' button that is a descendant of the parent popover should instead have aria-expanded=undefined as well.

spectranaut commented 11 months ago

Minutes for today's meeting: https://www.w3.org/2023/10/12-aria-minutes.html#t05