mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-19 20:48:09 +00:00
feat(ui/modules/Common/Form/Fields/TextField): set cursor position to 0 at end edition
This commit is contained in:
parent
c65a5b5fd4
commit
f6f32adf97
1 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue