升级到Angular 11后,Angular Material工具提示不起作用



我一直在应用程序中使用Angular Material工具提示,但当我最近升级到Angular 11时,它已经停止工作。我在模板中使用以下代码创建了一个测试组件,我直接从https://material.angular.io/components/tooltip/overview

<button mat-raised-button
matTooltip="Info about the action"
aria-label="Button that displays a tooltip when focused or hovered over">
Action
</button>

我打开了Chrome开发工具,当我悬停时,我可以看到对模板的更改,但我仍然看不到屏幕上的工具提示。

我已经安装了Angular Material,并且我已经导入了所有必要的模块,所以我不确定问题是什么(可能只是Angular Materials中的一个错误?(

我有一个自定义的主题.scss文件。我发现我需要一些主题中的工具提示条目,这是我以前没有的。不知道为什么现在需要,但以前没有。我添加了

tooltip: map_get($mat-grey, 700)

到我的scss文件中的几个位置。参见github.com/angular/components/issues/18139

最新更新