我正在構建一個聊天應用程序,其中ion-footer用作文本框+發送按鈕。當我點擊輸入框時,鍵盤彈出很好,因爲我需要。然而,當我點擊發送按鈕時,鍵盤會關閉,這對最終用戶來說是一種令人沮喪的體驗。angular2離子2保持鍵盤彈出
我明白這發生在鍵盤失去焦點時,離子將它推下。然而,這不是我想要的。如何保持鍵盤不變,直到我確實按下發送按鈕。
my current ionic 2 looks like
<ion-footer padding>
<form [formGroup]="chatForm" (ngSubmit)="sendChatMessage()">
<ion-input type="text" formControlName="messageInput" placeholder="start typing..."></ion-input>
<ion-buttons end>
<button item-right ion-button clear type="submit" [disabled]="chatForm.controls['messageInput'].value === ''"><ion-icon name="ios-send" style="zoom:2.0;"></ion-icon></button>
</ion-buttons>
</form>
</ion-footer>
什麼是TextInput?它是一個angular2模塊嗎?找不到。另外我應該手動設置焦點?理想情況下,如果我點擊頁腳區域內的任何地方,鍵盤應該保持焦點。 – Vik