Abstract away tooltip overlay triggers #1421
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
React Bootstrap's abstractions for tooltips is quite verbose. I'm adding a small component to make this a bit more palatable.
I'm also mitigating a very annoying issue, which is that when you click for instance on the "Clear sample list" button and then dismiss the dialog, the button receives focus again, which shows the tooltip.
That's because React Bootstrap's tooltips appear both on hover and on focus for accessibility; this is good but the way it's implemented is far from perfect, since when you close the dialog, you want to give focus back to the button but not show the tooltip... I couldn't find a workaround for this, unfortunately, but a way to mitigate it is to at least close the tooltip when clicking anywhere else on the screen. This is done with the
rootClose
prop, which was previously set on some tooltips but not all.