mohsinulhaq/react-popper-tooltip

Handling focus outside

equinusocio opened this issue · 0 comments

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

Kapture.2021-12-30.at.13.06.23.mp4