react-popper-tooltip
react-popper-tooltip copied to clipboard
Handling focus outside
Is your feature request related to a problem? Please describe.
Currently if 'focus' is not used as event trigger, closeOnOutsideClick is considered only on mouse click (is correct considering the name) but we need a way to close the tooltip also when the focus on the trigger is lost. For example if I have two consecutive triggers and make them accessibile, i would like to close the tooltip when the focus is moved, via keyboard, to another element that is not the trigger itself.
Describe the solution you'd like
Make closeOnOutsideClick also valid when focus outside, or make a specific closeOnOutsideFocus for focus which closes the previous opened tooltip.
Describe alternatives you've considered Using third-party clickAway hooks that are triggered also on focus.
Additional context
https://user-images.githubusercontent.com/10454741/147750558-1ee929bc-3ad0-4bc9-9bf8-97d557f27fba.mp4