gpt4 book ai didi

angular - Angular Material 2 选项卡标签中的输入不允许空格

转载 作者:行者123 更新时间:2023-12-05 06:33:11 25 4
gpt4 key购买 nike

我在选项卡标签中有一个输入,但注意到它不允许有空格。我尝试了 event.stopPropagation(); 但它没有用。有解决方法吗?

HTML:

<mat-tab-group>
<mat-tab>
<ng-template mat-tab-label>
Tab Label:
<input type="text" (input)="handleInput($event)">
</ng-template>
<h1>Tab</h1>
<p>Try entering a space in the input above</p>
</mat-tab>
</mat-tab-group>

TS:

handleInput(event: KeyboardEvent): void{
event.stopPropagation();
}

堆栈 Blitz :https://stackblitz.com/edit/angular-dwbjva

最佳答案

使用 (keydown) 而不是 (input)。

关于angular - Angular Material 2 选项卡标签中的输入不允许空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50877203/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com