Skip to content

Keeps the keyboard open while scrolling

Previously, scrolling closed the keyboard. It was difficult to answer to a message whom height was greater than the visible part of the screen, since scrolling to view the top of the message closed the keyboard, and reopening the keyboard moved the message.

The root cause is the text area looses focus when scrolling, and when it looses focus the keyboard is closed.

Now the focus is kept by the text area as long as it contains some text. That means it's possible to scroll with the keyboard closed if nothing has been typed, but if the text area contains something the keyboard stays open or is reopened if it was manually closed.

Note: the approach may not be perfect. I used onFocusChanged to refocus the text area, because using focusPolicy: Qt.NoFocus on the ScrollView didn't work.

Merge request reports