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

[Bug]: Combobox does not have aria-invalid attr #33490

Open
2 tasks done
Thomas-Neuhauser opened this issue Dec 19, 2024 · 4 comments
Open
2 tasks done

[Bug]: Combobox does not have aria-invalid attr #33490

Thomas-Neuhauser opened this issue Dec 19, 2024 · 4 comments

Comments

@Thomas-Neuhauser
Copy link

Package

react

Package version

8.120.5

React version

16.14.0

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
    Memory: 16.51 GB / 31.72 GB
  Browsers:
    Edge: Chromium (127.0.2651.86)
    Internet Explorer: 11.0.22621.3527

Current Behavior

We are facing accessibility issues using the ComboBox control.
This control is not setting an aria-invalid attribute corresponding to the presence of an error message set via errorMessage.
You can check the render output and behavior here:
https://developer.microsoft.com/en-us/fluentui#/controls/web/combobox

If you check the same for a DropDown or TextField you can see, that these controls always set an aria-invalid attribute to either false or true:
https://developer.microsoft.com/en-us/fluentui#/controls/web/dropdown
https://developer.microsoft.com/en-us/fluentui#/controls/web/textfield

Expected Behavior

All controls should consistently use the combination of aria-describedby, role="alert" and aria-invalid in order to let screen readers correctly react to error situations.
For the ComboBox we built a workaround using autofill for setting aria-invalid at the inner input field depending on the presence of an error message for the time being.

Reproduction

https://developer.microsoft.com/en-us/fluentui#/controls/web/combobox

Steps to reproduce

  1. Open https://developer.microsoft.com/en-us/fluentui#/controls/web/combobox
  2. In the page search for "ComboBox with static error message"
  3. Open the debugger and check the render output for the input field part of the ComboBox
  4. Notice that there is no aria-invalid="false" attribute
  5. Open https://developer.microsoft.com/en-us/fluentui#/controls/web/dropdown
  6. In the page search for "Dropdown with error message"
  7. Open the debugger and check the render output for the span part of the DropDown
  8. Switch the error on and off, notice that there is an aria-invalid attribute switched between true / false correspondingly

Are you reporting an Accessibility issue?

yes

Suggested severity

Medium - Has workaround

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@layershifter
Copy link
Member

layershifter commented Dec 19, 2024

Combobox

Image

Dropdown

Image

Looks like a bug, but I will let @smhigley to check 🐱

@layershifter layershifter changed the title [Bug]: [Bug]: Combobox does not have aria-invalid Dec 19, 2024
@layershifter layershifter changed the title [Bug]: Combobox does not have aria-invalid [Bug]: Combobox does not have aria-invalid attr Dec 19, 2024
@Thomas-Neuhauser
Copy link
Author

I don't think this makes sense. If there is an error, there should be an aria-invalid indicating this.
At least we get the feedback from our ACC testers that the current behavior doesn't work for them.
If they enter something invalid in a ComboBox and tab out of the field, the screenreader does not react to the error situation and read out the error.

@layershifter
Copy link
Member

@Thomas-Neuhauser yes, sorry I noticed it already. I updated my message 👍

@Thomas-Neuhauser
Copy link
Author

Ok I'm sorry now if my response doesn't fit exactly to what you wrote, since you finally now state "Looks like a bug..."
I responded to your original comment which I got notified about via mail but I see you edited it, so sorry if this is confusing now ;-)

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

No branches or pull requests

2 participants