angular / angular/components

feat(MatTooltip): Mimic native tooltip behaviour

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

描述

#### Feature Description

##### If nested elements have `MatTooltip`s applied on them, show the innermost tooltip.

Suppose we have a `button` with a `span` inside it.

```html

Mat Tooltip

Native Tooltip

```

If both of these elements have the `title` attribute applied to them and we hover the `span`, the browser shows `title` text of the span.
However, if we use the `MatTooltip` directive, both tooltips are shown to the user.

[Minimal Reproduction on StackBlitz](https://mat-tooltip-vs-native-tooltip.stackblitz.io)

#### Use Case

Whenever you need to show different tooltips for parent and child elements.

贡献指南

打开贡献指南

调研方向

从链接的 StackBlitz 复现开始,检查嵌套元素的 MatTooltip 行为。完成标准是:将鼠标悬停在嵌套的 span 上时只显示其 tooltip,而将鼠标悬停在父 button 本身上时,父 button 的 tooltip 仍会显示。

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

评估

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

把新 issue 发到你的邮箱

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