aria-labelledby and tabIndex: Type 'null' is not assignable
See original GitHub issueDescribe the issue. What is the expected and unexpected behavior?
When compiling our project using PF, TypeScript fails:
node_modules/@patternfly/react-core/dist/js/components/Dropdown/DropdownItem.d.ts:3:18 - error TS2430: Interface 'DropdownItemProps' incorrectly extends interface 'InternalDropdownItemProps'.
Types of property 'tabIndex' are incompatible.
Type 'number | null | undefined' is not assignable to type 'number | undefined'.
Type 'null' is not assignable to type 'number | undefined'.
3 export interface DropdownItemProps extends InternalDropdownItemProps {
~~~~~~~~~~~~~~~~~
node_modules/@patternfly/react-core/dist/js/components/Modal/Modal.d.ts:3:18 - error TS2430: Interface 'ModalProps' incorrectly extends interface 'HTMLProps<HTMLDivElement>'.
Types of property ''aria-labelledby'' are incompatible.
Type 'string | null | undefined' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.
3 export interface ModalProps extends React.HTMLProps<HTMLDivElement> {
I believe these two lines should not include the null option:
Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around?
Bug
What is your product and what release version are you targeting?
“@patternfly/react-core”: “^4.18.5”,
Data Driven Forms
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Argument of type null is not assignable to parameter of type ...
I solved the problem this way: Imported RadioGroupState from @react-stately/radio . Assigned the context component with the type:
Read more >What happens when aria-label, aria-labelledby and aria ...
Ignored on static content not listed above unless given an interactive role and tabindex=0 , and then only if the users tabs to...
Read more >aria-labelledby - Accessibility - MDN Web Docs
The aria-labelledby property enables authors to reference other elements on the page to define an accessible name. This is useful when using ...
Read more >Slide toggle | Angular Material
ariaLabelledby : string | null ... Whether the slide-toggle element is checked or not. @Input() ... Tabindex to which to fall back to...
Read more >ANDI - Alerts
Accessibility Components that use id references are: aria-labelledby ... element was found on the page with a non-numeric value for the tabindex attribute....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This problem is not specific to React, but to destructured props with default values. Example.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.