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: pass ref to renderSwitcher props #1107

Closed
wants to merge 2 commits into from
Closed

Conversation

KirillDyachkovskiy
Copy link
Contributor

No description provided.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@@ -154,11 +158,13 @@ const DropdownMenu = <T,>({
{/* FIXME remove switcher prop and this wrapper */}
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
<div
//@ts-ignore
ref={anchorRef}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ref is passed twice, yes it will return the second element, but is it better to add a check like this Boolean(render Switcher) ? undefined : controlRef

{renderSwitcher?.({onClick: handleControlClick, onKeyDown: handleControlKeyDown}) ||
<div
//@ts-ignore
ref={controlRef}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ref is passed twice, yes it will return the second element, but is it better to add a check like this Boolean(render Switcher) ? undefined : controlRef

@amje amje deleted the a11y-pass-ref branch July 16, 2024 15:55
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