Re: aria-pressed

Thank you all for your help.
Yes, the individual accordions can be expanded/ collapsed. When the
accordions are in the mixed state( expanded and collapsed) state then both
buttons will have aria-pressed as false.

In short, it is *fine* to use *aria-pressed* attribute on these buttons in
this scenario.

Please let me know if you wont agree with it.

Thanks,
Siri

On Sat, Feb 6, 2021, 5:44 AM Patrick H. Lauke <redux@splintered.co.uk>
wrote:

> On 06/02/2021 11:30, Léonie Watson wrote:
> > If you want to keep both buttons then you can set aria-pressed="true" on
> > the button that is pressed, and automatically set aria-pressed="false"
> > on the other button. You do not need to use the disabled attribute.
>
> Adding to what Léonie said, I'd say that this approach would only make
> sense if the expand and collapse buttons are truly the only two
> different states of this accordion. However, I suspect that in this
> accordion a user can also go in an open/close individual accordion
> panels - at which point there's then a mismatch between what the two
> buttons indicate (the accordion is fully expanded / the accordion is
> fully collapsed), which then becomes even more confusing (e.g. a user
> may have pressed the "expand all", it's now indicated as being
> "pressed", but the user went in and collapsed all the accordion panels
> manually...but according to the state conveyed by the two buttons, the
> accordion is nomally all expanded, since the "expand all" control still
> exposes that it's "pressed").
>
> Long story short, I'd keep them as momentary action buttons that do not
> need to convey any kind of state. If you want to get fancy, you could
> also update their "disabled" property dynamically depending on the state
> of all the accordion panels - e.g. when the user presses "expand all",
> expand all panels and set the button to be disabled, since it now
> doesn't serve any more purpose. But if the user goes in an collapses
> even one of the panels, make the "expand all" button active/non-disabled
> again, because now activating the button would serve a purpose again.
> But honestly, that becomes rather ... fiddly.
>
> P
> --
> Patrick H. Lauke
>
> https://www.splintered.co.uk/ | https://github.com/patrickhlauke
> https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
> twitter: @patrick_h_lauke | skype: patrick_h_lauke
>
>

Received on Saturday, 6 February 2021 20:10:24 UTC