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 does not close if focus is triggered by keyboard but removed mouse #4503

Closed
dlech opened this issue Jan 26, 2021 · 8 comments · Fixed by #4512 or #5080
Closed

Tooltip does not close if focus is triggered by keyboard but removed mouse #4503

dlech opened this issue Jan 26, 2021 · 8 comments · Fixed by #4512 or #5080

Comments

@dlech
Copy link
Contributor

dlech commented Jan 26, 2021

Environment

  • Package version(s): @blueprintjs/[email protected], @blueprintjs/[email protected]
  • Operating System: Ubuntu 20.04
  • Browser name and version: Chromium Version 88.0.4324.96 (Official Build) snap (64-bit), Firefox 85.0

Code Sandbox

Link to a minimal repro (fork this code sandbox): https://codesandbox.io/s/blueprint-sandbox-forked-146cf?file=/src/CoreExample.tsx

The example has been modified to add Tooltip2 around the Core Sandbox buttons.

FWIW, the same happens with the deprecated Tooltip.

Steps to reproduce

  1. click on a blank part of the browser
  2. press tab on the keyboard to focus the buttons
  3. wait for one second for the tooltip to appear
  4. click on a blank area of the browser to remove the focus from the button

Actual behavior

The tooltip stays open

Expected behavior

The tooltip should close since the focus is lost

Possible solution

?

@dlech
Copy link
Contributor Author

dlech commented Jan 26, 2021

Once you get the hang of it, you can end up with this:

image

@adidahiya
Copy link
Contributor

Fix open in PR #4512

@dlech
Copy link
Contributor Author

dlech commented Feb 8, 2021

This issue still exists. I have updated the sandbox to [email protected] and the problem is still reproducible.

@dlech
Copy link
Contributor Author

dlech commented Feb 8, 2021

vokoscreen-2021-02-08_12-43-35.mp4

@adidahiya
Copy link
Contributor

@dlech did you also upgrade the core package? there was a change made there targeting this issue.

@dlech
Copy link
Contributor Author

dlech commented Feb 8, 2021

yes, I upgraded all packages in the sandbox

@dlech
Copy link
Contributor Author

dlech commented Dec 20, 2021

Possible solution

?

Would it work to use onfocusout instead of onblur?

dlech added a commit to dlech/blueprint that referenced this issue Dec 21, 2021
The assumption that "a click handler somewhere else will close the popover if necessary" does not appear to be valid. If the user clicks on a non-focusable element. There are no other events that cause the popover to close other than mouseleave, but the mouse is not over the target when focus is lost.

Fixes palantir#4503.
@adidahiya
Copy link
Contributor

I made an updated sandbox to verify that it is still a bug: https://codesandbox.io/s/blueprint-sandbox-forked-eiv42?file=/src/CoreExample.tsx

In fact you can repro it on the Tooltip2 docs page, as I mentioned in #5080 (comment)

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