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]: Rating component itemLabel prop doesn't do anything #33360

Closed
2 tasks done
nanabear0 opened this issue Nov 27, 2024 · 1 comment · Fixed by #33361
Closed
2 tasks done

[Bug]: Rating component itemLabel prop doesn't do anything #33360

nanabear0 opened this issue Nov 27, 2024 · 1 comment · Fixed by #33361

Comments

@nanabear0
Copy link
Contributor

nanabear0 commented Nov 27, 2024

Component

Rating

Package version

9.54.6

React version

17.0.2

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
    Memory: 35.47 GB / 63.95 GB
  Browsers:
    Edge: Chromium (130.0.2849.56)
    Internet Explorer: 11.0.26100.1882

Current Behavior

I am trying to update the aria-labels for the RatingItems created by the Rating component. The docs tells me itemLabel callback will be used to create the label. but this prop seems to be ignored. Even though I am passing this callback the aria-label is always the rating number. I have put a debugger in the callback and I can tell that it is never getting triggered.

Expected Behavior

The callback passed to itemLabel should be called for each rating item and aria-label should be created accordingly.

Reproduction

https://stackblitz.com/edit/ukoutt?file=src%2Fexample.tsx

Steps to reproduce

Just launch the app.
Use devtools to look at the aria-labels,
Or use screen reader with keyboard navigation, the label that is announced is just the rating number.

Are you reporting an Accessibility issue?

yes

Suggested severity

High - No workaround

Products/sites affected

In app feedback sdk

Are you willing to submit a PR to fix?

yes

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants