components icon indicating copy to clipboard operation
components copied to clipboard

bug(TOOLTIP): Tooltip hide animation appears even if show delay not reached

Open dricks opened this issue 2 years ago • 13 comments

Is this a regression?

  • [X] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

13.2.4

Description

When using ShowDelay>0, and the cursor doesn't stay long enough to display the tooltip, when leaving the trigger element, the tooltip suddently appears and immediately starts the hide fade out animation. Very disturbing when switching between multiple trigger elements (buttons for instance) with tooltips because if you move quickly over them, they all display the tooltip fade out animation

NB: I'm also using "disableTooltipInteractivity=true" to remove the "blocked by tooltip" side effect started from 13.2.5

Reproduction

Steps to reproduce:

  1. Add a tooltip with a showDelay of 2000ms: <span matTooltip="The phantom tooltip" matTooltipShowDelay="2000">hello, i have a tooltip. Move quickly over me</span>
  2. Move the mouse over the span element, and leave before the show delay elapsed

Expected Behavior

The tooltip should'nt be shown at all because the showDelay was not reached

Actual Behavior

The hide animation plays, making the tooltip briefly appearing

Environment

  • Angular: 13.3.0
  • CDK/Material: 13.3.0
  • Browser(s): Chromium 98
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

dricks avatar Mar 17 '22 18:03 dricks

Any update on this?

rajibhasan11 avatar Apr 09 '22 07:04 rajibhasan11

That's annoying. Here's just a demo: demo

<mat-list>
  <mat-list-item *ngFor="let item of items" [matTooltip]="item.name">{{ item.name }}</mat-list-item>
</mat-list>
@NgModule({
  // ...
  providers: [
    {
      provide: MAT_TOOLTIP_DEFAULT_OPTIONS,
      useValue: { showDelay: 500 },
    }
  ]
  // ...
})
export class AppModule {}

infacto avatar Apr 13 '22 10:04 infacto

guys, please fix it.

anton-white avatar Jun 25 '22 20:06 anton-white

Hello Angular Team!

rajibhasan11 avatar Jun 26 '22 03:06 rajibhasan11

You can even use the official demos to demonstrate the bug:

image

msch-alpgis avatar Jun 27 '22 05:06 msch-alpgis

this silly thing is blocking us from upgrading material and angular to 14.x. we are stuck with 13.2.4 :(

ctaepper avatar Jul 16 '22 14:07 ctaepper

RIP mat tooltip

rajibhasan11 avatar Jul 19 '22 06:07 rajibhasan11

Temporary fix - add this to main style file:
.mat-tooltip-hide { display: none!important; }
It hides animation so tooltip doesn't appear on mouseleave before showDelay

pzywy avatar Jul 20 '22 13:07 pzywy

14.1.0 - the same issue! not fixed

Alecto avatar Jul 28 '22 07:07 Alecto

I've subscribed to the topic as I want to know when this gets fixed

IgnacioHR avatar Jul 28 '22 16:07 IgnacioHR

Temporary fix - add this to main style file: .mat-tooltip-hide { display: none!important; } It hides animation so tooltip doesn't appear on mouseleave before showDelay

for now, this works for sure. thanks

gabrielpuddo avatar Aug 01 '22 23:08 gabrielpuddo

Problem still happens in version 14.2.0

cosme-benito avatar Sep 01 '22 10:09 cosme-benito

it stil happens on the example page. https://material.angular.io/components/tooltip/overview#show-and-hide-delays

Set hide delay to zero. If that is not done, it looks at first it doesn't happen.. but after a few tries it does.

Brutusn avatar Sep 06 '22 07:09 Brutusn

14.2.1 - Regression still there!

AStrelkov avatar Sep 15 '22 09:09 AStrelkov

14.2.3 - The problem is not solved! Regression appears when the pointer moves in the vertical direction.

AStrelkov avatar Sep 29 '22 16:09 AStrelkov

I don't see the issue in the docs site anymore. Are you sure that you're testing the latest code?

crisbeto avatar Sep 29 '22 16:09 crisbeto

I still see the issue on the docs site. Here is a clip https://www.loom.com/share/314c84833a29481cae77a3d3c3c51e30

tuurbo avatar Sep 29 '22 16:09 tuurbo

Okay, I see. The cases I was testing for was when there's no enter delay and a hide delay, and the opposite way around.

crisbeto avatar Sep 29 '22 16:09 crisbeto

Are the examples on the docs website actually using the corresponding version in the code? Just asking because FWIW in my project I don't see the issue anymore after updating to 14.2.3 .

kungufli avatar Sep 29 '22 17:09 kungufli

It seems that the problem appears when the mouse pointer moves from top to down only. In other directions I don't see this regression. At least in my component with mat-table.

AStrelkov avatar Sep 29 '22 19:09 AStrelkov

With default tooltip options I found problem that tooltip is appearing immediately without any delay however I am using below tooltip options I don't see problems in my project.

export const DesignerTooltipDefaults: MatTooltipDefaultOptions = { position: 'above', showDelay: 800, hideDelay: 500, touchendHideDelay: 1000 };

rajibhasan11 avatar Sep 30 '22 03:09 rajibhasan11

Still reproduces in 14.2.4 version when moving mouse down and leave trigger element: Screen Recording 2022-10-06 at 13 24 34

ToniaDemchuk avatar Oct 06 '22 10:10 ToniaDemchuk

This is working as expected. As of a few versions ago, we stopped closing the tooltip by default when the user hovers over it. You can turn it off using the disableTooltipInteractivity option.

crisbeto avatar Oct 06 '22 10:10 crisbeto

Tooltip interactivity makes sense if showDelay time has reached and I left. But the issue is that showDelay time has not reached, so the tooltip should not be shown regardless where I move the mouse.

ToniaDemchuk avatar Oct 06 '22 11:10 ToniaDemchuk

Either way, that would be a different issue from this one. Currently "interactivity" is considered as soon as the pointer enters the tooltip trigger.

crisbeto avatar Oct 06 '22 11:10 crisbeto

Thanks for response, disableTooltipInteractivity makes the trick for me now, I will make issue later.

ToniaDemchuk avatar Oct 06 '22 11:10 ToniaDemchuk

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.