有点棘手的情况.对于下面的代码,我添加了(keydown.enter)=“false”来忽略textarea中的break line / enter按钮
这导致用户问题,并希望按Enter键的现有行为应自动触发“保存按钮”
任何想法如何在仍然聚焦在textArea但忽略断裂线时触发Save按钮?
<textarea #textArea style="overflow:hidden; height:auto; resize:none;" rows="1" class="form-control" [attr.placeholder]="placeholder" [attr.maxlength]="maxlength" [attr.autofocus]="autofocus" [name]="name" [attr.readonly]="readonly ? true : null" [attr.required]="required ? true : null" (input)="onUpdated($event)" [tabindex]="skipTab ? -1 : ''" (keydown.enter)="false" [(ngModel)]="value"> </textarea >