I am making a phone chat application for Android, but I have a problem.
I have a text area field (where users can write their messages) and a button for sending messages.
When a user clicks on a text area, a keyboard appears. However, when the user presses a button to send a message, the text area field loses focus and the keyboard disappears. I would like to keep the keyboard displayed and return focus to the text area.
I tried to select a keyboard using
$('#text-area).focus()
But that did not work.
I also added this line to my config.xml file.
<preference name="KeyboardDisplayRequiresUserAction" value="false"/>
I tried using the plugin https://github.com/driftyco/ionic-plugins-keyboard . When the keyboard is hiding, it fires an event, but the only thing I can do is open it again with
cordova.plugins.Keyboard.show();
The problem is that hide / show keyboard and animation still run.
Any tips?
source share