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

mdTooltip: incorrectly reappears when sidenav closes #7869

Closed
sirbarrence opened this issue Apr 4, 2016 · 3 comments
Closed

mdTooltip: incorrectly reappears when sidenav closes #7869

sirbarrence opened this issue Apr 4, 2016 · 3 comments
Assignees

Comments

@sirbarrence
Copy link

As noted in #3525, when closing, an mdSidenav intentionally refocuses whatever element triggered it to open for accessibility reasons.

However, if there is an mdTooltip on the triggering element, this programmatic refocus of that element causes the tooltip to reappear. This doesn't seem like expected behavior for mdTooltip. Here it is in action:

output

That's a click on the chat bubble button, then a click outside the sidenav to close it, unexpected tooltip reappears, then another click to make the unexpected tooltip disappear.

This happens in Material v1.1.0-rc2 and v1.0.7 with Angular 1.5.3.
I've reproduced this in Chrome for Mac and IE 11 for Windows.

This happens with or without md-autohide on the md-tooltip.

I would suggest one of the following:

  • Provide an attribute on md-tooltip to opt-out of focus events triggering the tooltip to appear. (Is md-autohide supposed to do this? It's not entirely clear from the docs. But it does not solve the problem currently.)
  • Provide an attribute on md-sidenav to opt-out of the autofocus-trigger-elment-on-close behavior.
  • Change md-tooltip so that it magically knows that programmatically-triggered focus events should not cause it to appear. No idea how you'd accomplish that.
@devversion
Copy link
Member

Duplicate of #5563 - Fix is already pending #7965

@FreakTheMighty
Copy link

I've found a related behavior and want to make sure its duplicate of this ticket. It can be reproduced on the Speed Dial Demo here: https://material.angularjs.org/latest/demo/fabSpeedDial

On the second demo showing the use of tooltips

  • On Chrome, change to mobile emulation
  • Click on the hamburger fab
  • Click on the "Facebook" button

Notice that the tooltip disappears then briefly reappears.

Even md-autohide=false is not respected because the element isn't currently in focus.

if (autohide || mouseActive || ($document[0].activeElement !== parent[0]) ) {

I'm not sure if that's the correct behavior, but it appears that the button doesn't take focus when tapped on a mobile device.

.on('focus', function() {

@devversion
Copy link
Member

@FreakTheMighty As you referenced in #7965, I took a look at your issue and this seems to be something different. Please open a new issue, so we can track it / and investigate.

@Splaktar Splaktar removed this from the - Backlog milestone Feb 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants