当我从父元素到子元素时,我想防止点击事件。我正在尝试使用剑道网格和剑道寻呼机。
以下是示例-https://stackblitz.com/edit/angular-gjgypw-qmo6s6?file=app/app.component.ts
<ng-template kendoPagerTemplate let-totalPages="totalPages" let-currentPage="currentPage">
<!-- This button should not be clicked when coming from parent element -->
<button kendoGridFocusable (click)="sample()">Sample</button>
<kendo-pager-prev-buttons></kendo-pager-prev-buttons>
<kendo-slider
kendoGridFocusable
[showButtons]="false"
tickPlacement="none"
[max]="totalPages"
[min]="1"
(valueChange)="sliderChange($event)"
[value]="currentPage">
</kendo-slider>
<kendo-pager-next-buttons></kendo-pager-next-buttons>
<input
kendoGridFocusable
class="k-textbox k-input k-rounded-md"
type="number"
[value]="pageSize"
(change)="onPageSizeChange($event.target.value)" />
<kendo-pager-info></kendo-pager-info>
</ng-template>
当我按下enter button
进入并访问按钮时,按钮被点击了。如果您看到示例,每当我们是寻呼机时,我们都需要按enter
键才能访问其中的所有按钮,而按Esc
键才能访问外部。按钮应可点击,但在里面输入时不应点击。
您是否尝试捕获enter事件并-->event.stop传播