首页 > 解决方案 > 关注 ng-template 中的元素

问题描述

我使用 ng-template 创建了一个自定义面板,该面板应通过单击按钮打开。我还想支持键盘导航。问题是,当我在关注按钮时单击 enter 时,焦点不会传递给 ng-template 中的元素,它传递给按钮的下一个兄弟。我在这里创建了一个示例,我假设当显示 ng-tempalte 时我需要专注于选择控件,问题是它返回未定义。

标签: angular-materialangular11

解决方案


推荐阅读