Bartlomiej Moskal eb3291f32d Android: Set correct initial selection values in EditorInfo
Previously, when a TextInput field was pre-filled with text,
focusing the input would cause the keyboard to behave incorrectly.
Typing any character would duplicate the last word. This appeared
to be caused by the keyboard reapplying a composition segment
(e.g., the last word), without a proper pre-edit region
defined—resulting in the word being appended again.

This issue is resolved by correctly setting
EditorInfo.initialSelStart and EditorInfo.initialSelEnd when the
InputConnection is created. Properly initializing these values
ensures the IME (input method editor) can synchronize with the text
field correctly. It can be found in [0]documentation:

  "Also, take good care to fill in the EditorInfo object correctly and
   in its entirety, so that the connected IME can rely on its values.
   For example, EditorInfo.initialSelStart and EditorInfo.initialSelEnd
   members must be filled in with the correct cursor position for IMEs
   to work correctly with your application."

[0]https://developer.android.com/reference/android/view/View#onCreateInputConnection(android.view.inputmethod.EditorInfo)

Pick-to: 6.8 6.5
Fixes: QTBUG-135481
Change-Id: I5ae5a2fb22f285154ba3857033506d367bfd7642
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 6de8ce2af383c8d164c65ffca7dc845c52e4f2d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-24 20:36:54 +00:00
2024-11-05 14:36:16 +01:00
2015-08-18 19:59:14 +00:00
2024-11-05 14:36:16 +01:00
2025-05-09 07:47:06 +01:00
2025-05-09 07:47:06 +01:00
2025-03-25 08:40:27 +00:00
2024-06-25 11:44:00 +02:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%