Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.3
-
None
Description
Steps to reproduce:
1) have a TextInput with a explicit width.
2) add text so that the TextInput starts to scroll (more than it's width)
3) Move the cursor before the last word and start typing a word in preedit
4) type until the cursor is at the right edge
5) commit the word
Expected result:
word is committed and the textinput scrolls one character
Actual result:
word is committed but the TextInput scrolls the length of the word being commited
After some study I found out that QDeclarativeTextInputPrivate::updateHorizontalScroll gets called after adding the preedit word and not yet having the preedit text reseted. This leads to scrolling too much.
The problem was solved by moving
setPreeditArea(m_cursor, event->preeditString());
in void QLineControl::processInputMethodEvent(QInputMethodEvent *event) before the
if (!event->commitString().isEmpty())
This is critical for us since unexpected scrolling breaks our custom behavior (in addition to looking weird).