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

Tooltip trigger=["focus", "hover"] does not work properly together #34064

Closed
1 task done
pobch opened this issue Feb 15, 2022 · 1 comment
Closed
1 task done

Tooltip trigger=["focus", "hover"] does not work properly together #34064

pobch opened this issue Feb 15, 2022 · 1 comment
Labels
❓FAQ issues would be discussed a lot

Comments

@pobch
Copy link
Contributor

pobch commented Feb 15, 2022

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Go to https://codesandbox.io/s/musing-river-r4jpu?file=/src/App.js
  2. Click the second input
  3. Move the mouse out of the input

What is expected?

After step 3, the Tooltip should still be shown since we use trigger=["focus", "hover"] as a prop in Tooltip.

What is actually happening?

The second Tooltip only works in hover mode, not focus mode.

Environment Info
antd 4.18.7
React 17.0.2
System mac os 12.1
Browser Firefox 96
@zombieJ
Copy link
Member

zombieJ commented Feb 1, 2023

Discussed about this case. Current behavior is work as expect. any of trigger reach hide condition should makes tooltip hide instead of each condition reach hide.

For example, if config trigger={['hover', 'click']}, user mouse enter and show the tooltip. User click on the content and then mouse leave. If all the condition takes into count, click to open is true but user can not aware this. They only see that mouse enter to show and mouse leave not hide.

Similar to ['focus', 'hover'], when user mouse enter and click to get focus, they found tooltip show expected by hover but not aware of focus. When mouse leave but not lose focus, the tooltip still exist will make confuse.

If want to all the condition should keep to show, my suggestion is to HOC for counter. But origin Tooltip component will no handle this.

@zombieJ zombieJ added ❓FAQ issues would be discussed a lot and removed 🐛 Bug Ant Design Team had proved that this is a bug. Inactive labels Feb 1, 2023
@zombieJ zombieJ closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓FAQ issues would be discussed a lot
Projects
None yet
Development

No branches or pull requests

4 participants