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

mdTooltip: incorrectly reappears when sidenav closes #7869

Closed

Description

@sirbarrence

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.

Activity

  1. modified the milestone: on Apr 20, 2016
  2. devversion commented on Apr 24, 2016

    @devversion
    Member

    Duplicate of #5563 - Fix is already pending #7965

  3. FreakTheMighty commented on May 11, 2016

    @FreakTheMighty

    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() {

  4. devversion commented on May 24, 2016

    @devversion
    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.

  5. removed this from the - Backlog milestone on Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions