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

SubMenu uses title prop to display menu title which also triggers html title tooltip #12277

Closed
1 task done
raptoria opened this issue Sep 17, 2018 · 3 comments
Closed
1 task done
Assignees

Comments

@raptoria
Copy link

raptoria commented Sep 17, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.9.2

Environment

Using Chrome on Windows

Reproduction link

https://github.com/ant-design/ant-design/blob/master/components/dropdown/demo/sub-menu.md

Steps to reproduce

Set the title attribute on sub menu.

    <SubMenu title="sub menu">
      <Menu.Item>3rd menu item</Menu.Item>
      <Menu.Item>4th menu item</Menu.Item>
    </SubMenu>

What is expected?

considering renaming the attribute which displays the SubMenu's name, so the html tooltip doesn't get triggered

What is actually happening?

HTML tooltip is triggered when hovering over sub menu - this may not be a feature the user wants


this is viewable within the demo page (Cascading Menu example)
https://github.com/ant-design/ant-design/blob/master/components/dropdown/demo/sub-menu.md

@chenshuai2144
Copy link
Contributor

I am very sorry, but for the time being we have no way to close this.
Do you have time to mention a pr?

@zombieJ
Copy link
Member

zombieJ commented Oct 17, 2018

Maybe deprecated the prop of title use label instead is better. Since MenuItem can also use title prop to show the html title tooltip.

@raptoria
Copy link
Author

raptoria commented Oct 18, 2018

It seems the way to specify the title for rc-menu without seeing the HTML title attribute at the same time is to wrap the plain text in a span, so instead of

 <SubMenu title="sub menu">

do this:

 <SubMenu title={<span>sub menu</span>}>

I think I can live with that.

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

3 participants