Don't hide keyboard on click action IOS 11

Viewed 1740

After I click on Send button in ionic app keyboard is hide. My code:

<ion-item>
    <ion-labe>Text</ion-label>
    <ion-textarea [(ngModel)]="text" placeholder="Write a Message …"></ion-textarea>
</ion-item>
<a (click)="sendMessage();">Send</a>

I need the keyboard stay open after Click action. Help me please.

2 Answers

I add textarea focus on Click action and its work perfectly. Code:

<ion-item>
    <ion-labe>Text</ion-label>
    <ion-textarea #index1 [(ngModel)]="text" placeholder="Write a Message …"></ion-textarea>
</ion-item>
<a (click)="sendMessage();index1.setFocus();">Send</a>

Check Ionic Keyword plugin if you want to reopen keyword again which give you many methods related to keyword like cordova.plugins.Keyboard.show();

https://github.com/ionic-team/ionic-plugin-keyboard

and sendMessage() In this method what functionality you are doing which hiding keyword because in above code I am not getting any keyword related issue

Related