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

fix: select a11y issues #4668

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: select a11y issues",
"packageName": "@microsoft/fast-foundation",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ export const SelectTemplate: ViewTemplate<Select> = html`
<div
aria-activedescendant="${x => (x.open ? x.ariaActiveDescendant : null)}"
aria-controls="listbox"
aria-expanded="${x => x.ariaExpanded}"
aria-haspopup="listbox"
aria-labelledby="selected-value"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This DOM element was requiring a label (or aria-labelledby) in order to be a11y compliant

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, but we should run this via ARIA 1.2 rather than 1.1 as the implications are significant. Is there a way for you to validate against ARIA 1.2 in AXE instead of 1.1?

class="control"
part="control"
role="button"
role="textbox"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Axe was looking for a child with the textbox role (as per the combobox spec)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah - @m4thieulavoie I think Axe is outdated. The combobox from ARIA 1.1 and 1.2 are significantly different. Should this be combobox rather than textbox? This doesn't fully support free input of text, so I'm not sure that textbox is accurate. Technically I think this is the select-only combobox: https://w3c.github.io/aria-practices/#examples-2

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, let me check the axe version. However, the host already has the combobox role. So perhaps button was the right one here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisdholt you were absolutely right. Axe has this opened issue to add support for the 1.2 combobox.
I'll close this PR as it seems to be a false alarm on our end!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good! Once that AXE update is out, we'd love you to take another pass :)

?disabled="${x => x.disabled}"
>
${startTemplate}
<slot name="button-container">
<div class="selected-value" part="selected-value">
<div class="selected-value" part="selected-value" id="selected-value">
<slot name="selected-value">${x => x.displayValue}</slot>
</div>
<div class="indicator" part="indicator" aria-hidden="true">
Expand Down