-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Components: Avoid displaying tooltip on focus from mousedown #16800
Conversation
It looks like this change invalidated several snapshots saved for unit tests: I guess |
@@ -35,13 +35,29 @@ class Tooltip extends Component { | |||
TOOLTIP_DELAY | |||
); | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be just a multiline comment with //
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be just a multiline comment with
//
?
It's meant to be JSDoc describing the instance variable. I guess including @type
(like in the subsequent one) could help make this clearer).
Thanks. Updated in 3363cb6. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good and it works as advertised in my testing 👍
I didn't discover any regressions when using keyboard only and tabbing between icon-only buttons.
* Components: Avoid displaying tooltip on focus from mousedown * Testing: Update Tooltip snapshots * Components: Tooltip: Add JSDoc type for assigned cancelIsMouseDown
* Components: Avoid displaying tooltip on focus from mousedown * Testing: Update Tooltip snapshots * Components: Tooltip: Add JSDoc type for assigned cancelIsMouseDown
This pull request seeks to resolve an issue where a button with an associated tooltip will briefly flash the tooltip when clicked. The underlying issue here is that a tooltip is expected to be shown (immediately) when a button is focused. Previously, this was not disambiguated from focus which results from clicking to interact with the button, where the tooltip is not expected to be shown.
Testing instructions:
Verify there are no regressions in the display of the tooltips being shown upon focusing the button.
Verify that the tooltip is not shown when clicking on a button with an associated tooltip (e.g. inserter, block movers, etc).
Needs Accessibility Feedback: I'd appreciate any advice on whether I've overlooked any use cases with the assumption that focus-via-click should be ignored.