angular / angular/components

[Tooltip] Tooltip does not vanish after route navigation with reusable routes

未关闭
#11,478 12 条评论 16 个 reaction 已指派 0 人 在 GitHub 查看
area: material/tooltip P3
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

#### Bug, feature request, or proposal:

Bug

#### What is the expected behavior?

A displayed tooltip should vanish, after navigating to a route with a different component.

#### What is the current behavior?

When a RouteReuseStrategy is implemented, then the tooltip doesn't vanish if the original route is detached while the tooltip was visible.

#### What are the steps to reproduce?

StackBlitz example: https://stackblitz.com/edit/angular-yvcjzp

A tooltip is displayed on button "Goto Page 2". Clicking on the button will navigate to page 2. This will causes the tooltip from page 1 to be stuck on the screen. It will only vanish once the user navigates back to page 1 again.

Disabling reusable routes by removing the custom RouteReuseStrategy will lead to the the expected behavior again:

```
providers: [
// remove this, and the tooltip starts to work properly
{ provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
],
```

#### What is the use-case or motivation for changing an existing behavior?

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?

"dependencies": {
"@angular/animations": "6.0.0",
"@angular/cdk": "^6.0.0",
"@angular/common": "6.0.0",
"@angular/compiler": "6.0.0",
"@angular/core": "6.0.0",
"@angular/forms": "6.0.0",
"@angular/http": "6.0.0",
"@angular/material": "^6.0.0",
"@angular/platform-browser": "6.0.0",
"@angular/platform-browser-dynamic": "6.0.0",
"@angular/router": "6.0.0",
"core-js": "^2.4.1",
"rxjs": "^6.1.0",
"rxjs-compat": "^6.1.0",
"zone.js": "^0.8.26"
},

#### Is there anything else we should know?

贡献指南

打开贡献指南

调研方向

从链接的 StackBlitz 复现开始,检查启用自定义 RouteReuseStrategy 时导航期间的 tooltip 行为。将其与移除该 provider 后的导航进行比较;当从页面 1 显示的 tooltip 在导航到页面 2 时消失,且不需要返回页面 1,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。