Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.2
-
None
-
iPad, iOS15
Description
In iPad, while the keyboard is already visible, and when the focus of input widget is changed, the application is scrolled incorrectly.
In my test app, when I open the dialog, the first line gets the focus, and the keyboard comes up
I then click on the third line edit which is very close to the keyboard. At this point, I would expect the application to be scrolled further up. However, it did not scroll up (see screenshot below)
When I click back on the first line edit, the application then scroll up further.
Root cause:
In QWidget::setFocus, QWidgetPrivate::updateFocusChild is called before QApplicationPrivate::setFocusWidget. In QWidgetPrivate::updateFocusChild, QIOSInputContext::scrollToCursor would be called which reads QApplication::inputMethod()::cursorRectangle(). However, the cursorRectangle is only updated correctly in QApplicationPrivate::setFocusWidget which would be called later on.