From f6f32adf974eec080fed28a430eb6d98cab65f0c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 May 2017 16:11:08 +0200 Subject: [PATCH] feat(ui/modules/Common/Form/Fields/TextField): set cursor position to 0 at end edition --- .../ui/modules/Common/Form/Fields/TextField.qml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/linphone-desktop/ui/modules/Common/Form/Fields/TextField.qml b/linphone-desktop/ui/modules/Common/Form/Fields/TextField.qml index b17fcc6f2..836f67613 100644 --- a/linphone-desktop/ui/modules/Common/Form/Fields/TextField.qml +++ b/linphone-desktop/ui/modules/Common/Form/Fields/TextField.qml @@ -11,10 +11,14 @@ import Common.Styles 1.0 Controls.TextField { id: textField + // --------------------------------------------------------------------------- + property alias icon: icon.icon property string error: '' property var tools + // --------------------------------------------------------------------------- + background: Rectangle { border { color: textField.error.length > 0 @@ -60,6 +64,18 @@ Controls.TextField { rightPadding: TextFieldStyle.text.rightPadding + toolsContainer.width selectByMouse: true + // --------------------------------------------------------------------------- + + onEditingFinished: cursorPosition = 0 + + onTextChanged: { + if (!focus) { + cursorPosition = 0 + } + } + + // --------------------------------------------------------------------------- + Icon { id: icon