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

aria-selected returned as string instead of boolean #1596

Closed
samueil opened this issue Apr 26, 2024 · 0 comments · Fixed by #1603
Closed

aria-selected returned as string instead of boolean #1596

samueil opened this issue Apr 26, 2024 · 0 comments · Fixed by #1603
Labels

Comments

@samueil
Copy link

samueil commented Apr 26, 2024

In my setup with useCombobox hook, I get the option attributes via getItemProps() function. It returns 'aria-disabled' as a boolean, but 'aria-selected' is returned as string.
As a workaround currently i need to cast it back and forth, which is inconvenient:

{
    ...downshiftItemProps,
    "aria-selected": (downshiftItemProps["aria-selected"] as unknown as string) === "true",
}

I assume it origins from here, where it could simply be changed to
'aria-selected': index === latestState.highlightedIndex, instead of the template string.

'aria-selected': `${index === latestState.highlightedIndex}`,

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

Successfully merging a pull request may close this issue.

2 participants