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

fix(Dropdown): aria labels not passed to dropdown menu #2707

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rivka-ungar
Copy link
Contributor

@rivka-ungar rivka-ungar requested a review from a team as a code owner January 8, 2025 18:31
@@ -30,7 +31,7 @@ const Menu = ({ children, Renderer, selectProps, dropdownMenuWrapperClassName, i
return (
<components.Menu
{...props}
innerProps={{ ...props.innerProps, onScroll: props.onScroll }}
innerProps={{ ...rendererProps.innerProps }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is breaking, isn't it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, who is ...props.innerProps? it seem like this attr doesn't even exist on props of menu

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it be breaking? Now there is a bug that the props.innerProps + scroll is passed but the id, role and aria-label are being ignored, so I just added them

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but is props.innerProps even a thing? where does it come from?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and if it is a thing, and it can contain id, role, aria-label, it means it's breaking since it overrides this change now always override those 3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from line 12, where the additional props are set

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the Menu component never gets a prop called inlineProps

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh it's a "react-select" prop which is automatically passed, I see now
we need to make sure inlineProps never includes one of those three
if it does, even in edge scenarios, it is kind of breaking

Copy link
Contributor

@YossiSaadi YossiSaadi Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it under our control? is it always not containing it in current scenario? or consumers can somehow pass something to our Dropdown causing it to pass innerProps with different role, id, and aria-label?

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

Successfully merging this pull request may close these issues.

2 participants