Skip to content
Snippets Groups Projects
Commit bd3939c3 authored by Jarkko Koivikko's avatar Jarkko Koivikko
Browse files

Fix cursor position in demo after leaving suggestion (fixes #7)

TextInput.cursorPosition does not take pre-edit text into account.
Therefore pre-edit text is committed before positioning the cursor
in mouse click handler.
parent ab05826c
No related merge requests found
......@@ -63,6 +63,8 @@ FocusScope {
parent: textBase
anchors.fill: parent
onClicked: {
if (editor.inputMethodComposing)
Qt.inputMethod.commit()
var positionInEditor = mapToItem(editor, mouseX, mouseY)
var cursorPosition = editor.positionAt(positionInEditor.x, positionInEditor.y)
editor.cursorPosition = cursorPosition
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment