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

[Feature Request]: ariaLabel removal or deprecation log changes #17584

Open
1 task done
ev-codes opened this issue Sep 26, 2024 · 4 comments
Open
1 task done

[Feature Request]: ariaLabel removal or deprecation log changes #17584

ev-codes opened this issue Sep 26, 2024 · 4 comments
Labels
afrohacks See https://ibm.biz/afrohacks-hackathon component: data-table hacktoberfest See https://hacktoberfest.com/ package: @carbon/react @carbon/react severity: 3 https://ibm.biz/carbon-severity status: help wanted 👐 type: bug 🐛

Comments

@ev-codes
Copy link

ev-codes commented Sep 26, 2024

The problem

getSelectionProps() (part of @carbon/react) returns ariaLabel as one of the properties.

However, <TableSelectAll> logs a deprecation warning to console.warn when ariaLabel is passed into it. Unnecessary logs make it more difficult to find more important issues and slow down CI workflows.

The solution

Either:

  • getSelectionProps() no longer returns ariaLabel
  • <TableSelectAll> should not log a deprecation warning when receiving ariaLabel

Examples

Code:

<TableSelectAll {...getSelectionProps()} aria-label="entity table select all" />

Logs from test:

console.warn
    Warning: This prop syntax has been deprecated. Please use the new `aria-label`.

Application/PAL

No response

Business priority

None

Available extra resources

No response

Code of Conduct

Copy link
Contributor

Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team.

If your proposal is accepted and the Carbon team has bandwidth they will take on the issue, or else request you or other volunteers from the community to work on this issue.

@sstrubberg
Copy link
Member

Hey @ev-codes, the warning is intentional and it meant to let you know that you need to change aria-label from ariaLabel. Stop by office hours if you need any more clarity!

@sstrubberg sstrubberg closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2024
@github-project-automation github-project-automation bot moved this from Triage to Completed 🚢 in Roadmap Sep 30, 2024
@AlanGreene
Copy link
Contributor

AlanGreene commented Sep 30, 2024

@sstrubberg As far as I understand it, the issue reported here is that the instance of ariaLabel triggering the warning is originating from Carbon's own implementation of the getSelectionProps function.

See for example

ariaLabel: string;
'aria-label': string;

The values returned include both ariaLabel and the expected aria-label.

A similar issue exists for a number of the other functions, e.g. getRowsProps, getExpandHeaderProps, etc.

Please reopen this issue.

@tay1orjones
Copy link
Member

tay1orjones commented Sep 30, 2024

Yeah, sorry for the confusion, this is something we need to fix in all the applicable DataTable prop getters.

<TableSelectAll> and the other DataTable components are correct in logging a deprecation warning for ariaLabel. aria-label should be used instead.

I'm not sure why the initial deprecation work didn't modify getSelectionProps() to no longer return ariaLabel and use aria-label instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
afrohacks See https://ibm.biz/afrohacks-hackathon component: data-table hacktoberfest See https://hacktoberfest.com/ package: @carbon/react @carbon/react severity: 3 https://ibm.biz/carbon-severity status: help wanted 👐 type: bug 🐛
Projects
Status: ⏱ Backlog
Development

No branches or pull requests

4 participants