I have an app that utilizes PhoneGap (HTML5, JavaScript, not native). There’s a vicious bug that pops up whenever I click on a TextArea in the app that moves some of my elements on the screen (specifically, it bungles things that are position:fixed).
To fix these issues, I would like to be able to disable the feature that scrolls the UIWebView when the keyboard pops up, but I’m unsure of how to do this.
Not sure if this is clear, or not, but how does one disable the scrolling of a UIWebView when the keyboard shows.
I think this is a bug (or rather missing feature?) in UIWebView. I worked around it by saving the
textView.scrollView.contentOffseton-keyboardWillShow:and setting thecontentOffsetto the saved value in-keyboardDidHide:Not nice, because you still see it briefly scrolling around, but less disturbing than completely losing the focus.
An alternative would be to implement the portion with the long text as a native UITextView where this kind of undesirable behavior does not happen.
Edit:
Yet another workaround is to not use
contenteditable. If you can manage to design a usual text input field, then the scrolling will zoom to the currently selected textfield (that’s also btw why the contenteditable behaves so strange, as it cannot find anything to zoom in on). Additionally the*!§*$previous-next keyboardInput bar becomes useful again.