-
Notifications
You must be signed in to change notification settings - Fork 279
Prevent keyboard from hiding #81
Comments
Random idea: could try toggling autofocus on an input? |
Thanks. I just tried it, but the input still doesn't receive focus. Is it necessary (or possible) to hack the keyboard plugin to make this work? I haven't read the source but thought I should check first before sinking time on it. |
I had a similar issue but in Android: the keyboard flashed because it got hidden when the input lost focus, and then reshown when the input regained focus. After testing with different configurations, finally I found something that worked for me: triggering the click event, and then the focus event for the input element. I don't know if that will work on iOS, but it's worth a try. The code looks like this: |
Make sure you have https://cordova.apache.org/docs/en/4.0.0/guide_platforms_ios_config.md.html#iOS%20Configuration |
@tlancina awesome, setting that pref to |
As a post-mortem note (this issue's page keep appearing first on Google): If you want to keep the keyboard open when user clicks a button (i.e on a "Send" or "Search" button), you should use This way was successfully tested on Ionic2. |
@edgebal - The solution works on android. Do we need to do something else for ios? |
@edgebal is it working with WKWebView too ? |
@edgebal Thank you so much :) @manishoswal @msio777 tested in iOS and seems to be working fine 👍 |
@edgebal It works, but it seems to break some underlying native functionality. On Android I'm seeing the textarea not being cleared correctly, and on iOS spelling suggestions become glitchy. Edit: |
Button within a slides control
Why?? The solution is to bind to the native events of the button and call I tried doing this with angular event bindings like normal but I was unsuccessful. I resorted to a more direct method of binding direct to the control. Would be great to see if we can add a directive to buttons embedded in slides which can prevent the slide from responding to the events. |
WOW @chrisjpalmer !!!! Thanks A LOT ! I'm using it in a chat and it works like a charm ! |
Here is a directive I made for suppressing events on a button based on @chrisjpalmer
|
Hi @johnthackstonanderson thanks so much. Thats a great innovation. I will give this a try a bit later. |
I'm building an app where I want the keyboard to stay open even after the input loses focus.
After reading posts on Ionic forum and StackOverflow, I tried to refocus on the text input after it loses focus. However, the input only gets focused in desktop browsers, not Safari iOS. It looks like iOS ignores calls to
focus()
, with or without wrapping in a timeout. This is what I tried:So, there are really two questions:
focus()
work on Safari iOS?Thanks!
The text was updated successfully, but these errors were encountered: