Skip to content
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

'previously selected' chip which disappears when you click its close button #1752

Closed
brennanyoung opened this issue Jun 7, 2022 · 2 comments

Comments

@brennanyoung
Copy link
Contributor

brennanyoung commented Jun 7, 2022

inputchip

A common UI element, not well met by the current ARIA spec is the (poorly named) "inputchip" described at https://m3.material.io/components/chips/guidelines

Even though the material docs state that "chips aren't buttons", all the other type of chip map very well onto existing ARIA roles, including button.

  • Assist and suggestion chips are (semantically) buttons
  • Filter chips are (semantically) checkboxes
  • I've seen chips behaving like radio buttons too (selectable, but mutually exclusive within their group)

This leaves "input chip" without a proper mapping. So what are input chips? They represent dismissible filters or selectors previously chosen by the user. They appear in (e.g.) Microsoft outlook when manipulating the email recipient list, but are not uncommon in web-based RIAs as quick filters based on previous interactions with e.g. checkboxes. A good real world example is to be found in ebay, where previous search filters appear as dismissible chips.

Note: These chips are sometimes used to populate drop-down menus. (Screenshot from ebay)

image

"Input chips" are somewhat similar to checkboxes or toggle buttons, except that they disappear when you click the checkmark. The chip can only be recreated through some other mechanism, typically in some other part of the UI. No other control behaves in quite this way. It's effectively a "single-use" toggle button.

For an implementation with today's ARIA, the button role is probably the best fit (although it's often the checkmark/closebox that behaves as a button, rather than the whole chip or label, since these are often draggable).

However, I don't like the idea of UI elements disappearing without fair warning. This may be a rare case where aria-roledescription might be called for. I also wonder whether aria-checked is at all relevant or appropriate here, since this would at least communicate (programmatically) that there is some kind of Boolean quality about the control, although it would only ever be "true" if the control is present.

This will require a change to CORE-AAM

A possible change of spec might entail

  • an attribute which convert a button into an inputchip (like aria-pressed converts a button to a toggle)
  • a new role, such as "inputchip"

An APG example would be useful

If an addition to ARIA is not desired, an APG example showing how to implement such a chip using the current spec would be valuable.

@jnurthen
Copy link
Member

jnurthen commented Jun 7, 2022

Is this a duplicate of #689 ?

@brennanyoung
Copy link
Contributor Author

Apart from the nomenclature, yes! Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants