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]: Proptype for aria-current in BreadcrumbItem is incorrect #15034

Closed
2 tasks done
Tresau opened this issue Oct 26, 2023 · 0 comments · Fixed by #15052
Closed
2 tasks done

[Bug]: Proptype for aria-current in BreadcrumbItem is incorrect #15034

Tresau opened this issue Oct 26, 2023 · 0 comments · Fixed by #15052

Comments

@Tresau
Copy link
Contributor

Tresau commented Oct 26, 2023

Package

@carbon/react

Browser

No response

Package version

v1.40.0

React version

No response

Description

The PropType definition for 'aria-current' is to broad. it is currently defined as 'aria-current': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]) however it will need to be modified to match AriaAttributes['aria-current']. This is causing issues with adding Typescript typings as well as the possibility of breaking if the user uses a specific type of and sets a non standard 'aria-current' value.

Reproduction/example

https://codesandbox.io/s/carbon-aria-current-f9lcrj?file=/src/App.js

Steps to reproduce

This does not show a break, however you can see that eslint is complaining that non standard strings can be used. There is a code path where the BreadcrumbItem can create a component and pass it the aria-current value. is already typed and only accepts the standard 'aria-current' values as shown below.
image

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

Cloud

Code of Conduct

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

Successfully merging a pull request may close this issue.

1 participant