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

Antd Menu Item doesnt accept ref #45553

Open
tempoeric opened this issue Oct 26, 2023 · 3 comments
Open

Antd Menu Item doesnt accept ref #45553

tempoeric opened this issue Oct 26, 2023 · 3 comments

Comments

@tempoeric
Copy link
Contributor

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Open the link and you will notice that the ref in menu 1 is throwing an error

What is expected?

Should be able to pass ref for menu items

What is actually happening?

Menu items doesnt accept ref

Environment Info
antd 5.10.2
React 18.2.0
System Windows 11
Browser Google Chrome
@Katarca
Copy link

Katarca commented Jan 15, 2024

Hi, we would like to use Ant Design Menu together with Ant Design Tours components. But we cant, because Menu Item doesnt accept a ref right now.

@tempoeric
Copy link
Contributor Author

Hi, we would like to use Ant Design Menu together with Ant Design Tours components. But we cant, because Menu Item doesnt accept a ref right now.

i think they still dont have fix regarding this issue

@github-actions github-actions bot removed the Inactive label Jan 15, 2024
@Jirijancik
Copy link

For now we found a workaround.

in the Menu item add an Icon with a ref (icon: <StarOutlined ref={refFavouritesButton} />)
then in Tour step use target: refFavouritesButton.current?.parentElement, - it needs an Element, so we provide parent of the Icon ref Element .. its dirty but for now it works

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

No branches or pull requests

4 participants