Nativescript - Keep keyboard open when TextField returned on Android -
how can keep keyboard open after user tap on "return" key on soft keyboard? i'm calling focus method on "returnpress" event, works fine on ios not on android:
text() { let textfieldelement = <textfield>this.textfield.nativeelement; textfieldelement.focus(); }
so turns out need overrde "oneditoraction" method on "oneditoractionlistener" this:
let tv = <textfield>this.textfield.nativeelement; if (tv.android) { tv.android.setoneditoractionlistener(new android.widget.textview.oneditoractionlistener({ oneditoraction: function (callbacktype, result) { if (result == android.view.inputmethod.editorinfo.ime_action_done) { // whatever want when user presses return } return true; } })); }
Comments
Post a Comment