Comment 0 for bug 1200371

Revision history for this message
Bill Filler (bfiller) wrote : auto-scroll input fields when OSK visibility changes

Currently when you select in an input field, it causes the osk to be displayed. If the field is located beneath the osk it is obscured. Currently many of the apps have to write special code to handle the osk visiblilty and handle scrolling of the field. This should be done automatically by the sdk if the app opt's in somehow.

Here is a pointer to code in lp:phone-app that makes the input filed for sending text messages scroll based on osk visibility. Same is repeated in webbrowser-app:

http://bazaar.launchpad.net/~phablet-team/phone-app/trunk/view/head:/src/qml/Widgets/KeyboardRectangle.qml
http://bazaar.launchpad.net/~phablet-team/phone-app/trunk/view/head:/src/qml/DetailViewCommunication/CommunicationView.qml#L235

You basically anchor the KeyboardRectangle item to the bottom of your view, and then the contents you want to scroll you anchor to the top of the KeyboardRectangle. This KeyboardRectangle is a normal item that has the size of the virtual keyboard.
When the keyboard is visible it has the height of the keyboard, when the keyboard is hidden, it has a height of 0