我正在开发聊天应用程序ionic 3 ios。 因此,单击“发送”按钮时,键盘应保持打开状态。 对于android,它工作正常,但对于ios则没有运气。 现在我已经放弃了一个多月。
我尝试了以下操作,但不起作用。 (1)this.sndbtn.setFocus(); (2)$ event.preventDefault()
代码
<ion-footer [class]="className" [keyboardAttach]="content" id="input-footer">
<ion-icon name="list-box" tappable (click)="openModal()"></ion-icon>
<ion-toolbar>
<ion-item class="input-item">
<ion-input #sndbtn id="msg" [disabled]="currentChatStatus (keypress)="addNewMsg($event, selectedChat)" class="msg-input-box"> </ion-input>
</ion-item>
</ion-toolbar>
<button ion-button (touchstart)="addNewMsg($event);$event.preventDefault()">
<ion-icon name="paper-plane"></ion-icon>
</button>
</ion-footer>