Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(tooltip): Fix md-tooltip showing when window receives focus #4191

Closed
wants to merge 1 commit into from
Closed

fix(tooltip): Fix md-tooltip showing when window receives focus #4191

wants to merge 1 commit into from

Conversation

mhchen
Copy link

@mhchen mhchen commented Aug 16, 2015

When the parent of an md-tooltip was clicked, it received focus. When
the window was blurred and re-focused (e.g. on tab change), the tooltip
shows again due to a new focus event firing. This fix prevents this
first focus event from having any effect. Note that this bug only
affected browsers that focus buttons on click.

Fixes #3035

@mhchen mhchen added this to the 0.12.0 milestone Aug 16, 2015
@ThomasBurleson
Copy link
Contributor

@mhchen - can you provide a test to accompany these improvements?

@ThomasBurleson ThomasBurleson added needs: tests in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs labels Aug 18, 2015
When the parent of an md-tooltip was clicked, it received focus. When
the window was blurred and re-focused (e.g. on tab change), the tooltip
shows again due to a new focus event firing. This fix prevents this
first focus event from having any effect. Note that this bug only
affected browsers that focus buttons on click.

Fixes #3035
@mhchen
Copy link
Author

mhchen commented Aug 19, 2015

@ThomasBurleson Rebased and re-pushed. The md-button module had to be pulled in in order to do actual simulation of the button.focus()/document.activeElement behavior. Because I was able to simulate this behavior (instead of relying on jasmine.mockElementFocus), it seemed like a good time to fix the fragility of the test above it as well.

@ThomasBurleson
Copy link
Contributor

@mhchen - 👍

@mhchen mhchen closed this in 954cab5 Aug 19, 2015
kennethcachia pushed a commit to kennethcachia/material that referenced this pull request Sep 23, 2015
When the parent of an md-tooltip was clicked, it received focus. When
the window was blurred and re-focused (e.g. on tab change), the tooltip
shows again due to a new focus event firing. This fix prevents this
first focus event from having any effect. Note that this bug only
affected browsers that focus buttons on click.

Fixes angular#3035. Closes angular#4191.
@ThomasBurleson ThomasBurleson removed the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Jan 19, 2016
@Splaktar Splaktar added the needs: unit tests This PR needs unit tests to cover the changes being proposed label Mar 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: unit tests This PR needs unit tests to cover the changes being proposed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

md-tooltip with md-autohide displays on window re-focus
3 participants