Skip to content
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

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

Closed
1 task done
dricks opened this issue Mar 17, 2022 · 27 comments · Fixed by #24652, #25699 or #25740
Closed
1 task done

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

dricks opened this issue Mar 17, 2022 · 27 comments · Fixed by #24652, #25699 or #25740
Assignees
Labels
area: material/tooltip P2 The issue is important to a large percentage of users, with a workaround

Comments

@dricks
Copy link

dricks commented Mar 17, 2022

Is this a regression?

  • 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 dricks added the needs triage This issue needs to be triaged by the team label Mar 17, 2022
volvachev pushed a commit to volvachev/components that referenced this issue Mar 23, 2022
… not visible tooltip

Fixes a bug in Angular Material `tooltip` when `mat-tooltip-hide` class trigger animation for not visible tooltip.

Fixes angular#24614
volvachev added a commit to volvachev/components that referenced this issue Mar 23, 2022
… not visible tooltip

Fixes a bug in Angular Material `tooltip` when `mat-tooltip-hide` class trigger animation for not visible tooltip.

Fixes angular#24614
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent has pr area: material/tooltip and removed needs triage This issue needs to be triaged by the team labels Apr 1, 2022
@rajibhasan11
Copy link

Any update on this?

@infacto
Copy link

infacto commented Apr 13, 2022

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 {}

volvachev added a commit to volvachev/components that referenced this issue Apr 15, 2022
… not visible tooltip

Fixes a bug in Angular Material `tooltip` when `mat-tooltip-hide` class trigger animation for not visible tooltip.

Fixes angular#24614
volvachev added a commit to volvachev/components that referenced this issue Apr 15, 2022
… not visible tooltip

Fixes a bug in Angular Material `tooltip` when `mat-tooltip-hide` class trigger animation for not visible tooltip.

Fixes angular#24614
@anton-white
Copy link

guys, please fix it.

@rajibhasan11
Copy link

Hello Angular Team!

@msch-alpgis
Copy link

msch-alpgis commented Jun 27, 2022

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

image

@ctaepper
Copy link

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

@rajibhasan11
Copy link

RIP mat tooltip

@pzywy
Copy link

pzywy commented Jul 20, 2022

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

@Alecto
Copy link

Alecto commented Jul 28, 2022

14.1.0 - the same issue!
not fixed

@IgnacioHR
Copy link

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

@gabrielpuddo
Copy link

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

wagnermaciel pushed a commit that referenced this issue Aug 4, 2022
… not visible tooltip (#24652)

Fixes a bug in Angular Material `tooltip` when `mat-tooltip-hide` class trigger animation for not visible tooltip.

Fixes #24614
wagnermaciel pushed a commit that referenced this issue Aug 4, 2022
… not visible tooltip (#24652)

Fixes a bug in Angular Material `tooltip` when `mat-tooltip-hide` class trigger animation for not visible tooltip.

Fixes #24614

(cherry picked from commit 3041cda)
wagnermaciel pushed a commit that referenced this issue Aug 4, 2022
… not visible tooltip (#24652)

Fixes a bug in Angular Material `tooltip` when `mat-tooltip-hide` class trigger animation for not visible tooltip.

Fixes #24614

(cherry picked from commit 3041cda)
@wagnermaciel wagnermaciel reopened this Aug 9, 2022
@cosme-benito
Copy link

Problem still happens in version 14.2.0

crisbeto added a commit that referenced this issue Sep 26, 2022
…ed (#25699)

After the tooltips were switched to CSS animations, a regression was introduced where the opposite animation is shown even if the tooltip didn't actually reach its target state.

These changes are an alternate take on the fix from #24652 which had to be reverted due to internal failures.

Fixes #24614.
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 26, 2022
…ed (angular#25699)

After the tooltips were switched to CSS animations, a regression was introduced where the opposite animation is shown even if the tooltip didn't actually reach its target state.

These changes are an alternate take on the fix from angular#24652 which had to be reverted due to internal failures.

Fixes angular#24614.
crisbeto added a commit that referenced this issue Sep 26, 2022
…ed (#25699) (#25701)

After the tooltips were switched to CSS animations, a regression was introduced where the opposite animation is shown even if the tooltip didn't actually reach its target state.

These changes are an alternate take on the fix from #24652 which had to be reverted due to internal failures.

Fixes #24614.
@AStrelkov
Copy link

AStrelkov commented Sep 29, 2022

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

@crisbeto
Copy link
Member

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

@tuurbo
Copy link

tuurbo commented Sep 29, 2022

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

@crisbeto
Copy link
Member

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 crisbeto reopened this Sep 29, 2022
@crisbeto crisbeto removed the has pr label Sep 29, 2022
@kungufli
Copy link

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 .

@AStrelkov
Copy link

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.

@rajibhasan11
Copy link

rajibhasan11 commented Sep 30, 2022

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
};

@crisbeto crisbeto added the has pr label Oct 2, 2022
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 2, 2022
…hrough tooltip

We ignore `mouseleave` events that go into the tooltip which meant that some animations weren't being cancelled correctly after the fix in angular#25699. These changes resolve the issue by skipping all animations if the tooltip isn't fully shown yet.

Fixes angular#24614.
crisbeto added a commit that referenced this issue Oct 3, 2022
…hrough tooltip (#25740)

We ignore `mouseleave` events that go into the tooltip which meant that some animations weren't being cancelled correctly after the fix in #25699. These changes resolve the issue by skipping all animations if the tooltip isn't fully shown yet.

Fixes #24614.
crisbeto added a commit that referenced this issue Oct 3, 2022
…hrough tooltip (#25740)

We ignore `mouseleave` events that go into the tooltip which meant that some animations weren't being cancelled correctly after the fix in #25699. These changes resolve the issue by skipping all animations if the tooltip isn't fully shown yet.

Fixes #24614.

(cherry picked from commit 6526277)
@ToniaDemchuk
Copy link

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

@crisbeto
Copy link
Member

crisbeto commented Oct 6, 2022

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.

@ToniaDemchuk
Copy link

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.

@crisbeto
Copy link
Member

crisbeto commented Oct 6, 2022

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

@ToniaDemchuk
Copy link

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

art-hck added a commit to art-hck/planing-poker that referenced this issue Oct 11, 2022
fix tooltip bug angular/components#24614
fix sharedRoom not emitted (modals not open)
fix back to rooms button
art-hck added a commit to art-hck/planing-poker that referenced this issue Oct 12, 2022
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.