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

how not to lose input focus when tippy is visible #122

Closed
ctf0 opened this issue Nov 13, 2017 · 2 comments
Closed

how not to lose input focus when tippy is visible #122

ctf0 opened this issue Nov 13, 2017 · 2 comments

Comments

@ctf0
Copy link

ctf0 commented Nov 13, 2017

atm if an item has focus & we hover it, it will lose its focus, is there away to avoid that ?

example

@atomiks
Copy link
Owner

atomiks commented Nov 14, 2017

In order to be able to keyboard navigate an interactive tooltip, it gets focused, so the input will lose focus.

If you want to disable that behavior, inside the onShown() callback, you can simply manually .focus() the input again.

https://www.webpackbin.com/bins/-Kys2pV-jeAInlTjiPqT

You will probably want to check if the input had focus inside onShow() so that you don't focus it inside onShown() if not necessary.

Also on an unrelated note: the reason the tooltip is closing in that example despite being interactive, is because a mouseleave on the body element will hide the tooltip, and in the case above, the body element only stretches to the bottom of the input/button and not to the top of the tooltip.

@ctf0
Copy link
Author

ctf0 commented Nov 14, 2017

awesome, many thanx

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

No branches or pull requests

2 participants