mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Make sure to imperatively set text for spinbox textfield after user breaks binding by editing
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
e84a5dcb5f
commit
aaeaad9918
1 changed files with 6 additions and 1 deletions
|
@ -676,7 +676,10 @@ Page {
|
|||
readonly property int dayInMSecs: 24 * 60 * 60 * 1000
|
||||
readonly property int expireDateReduced: Math.floor(root.expireDate / dayInMSecs)
|
||||
// Reset the model data after binding broken on user interact
|
||||
onExpireDateReducedChanged: value = expireDateReduced
|
||||
onExpireDateReducedChanged: {
|
||||
value = expireDateReduced;
|
||||
expireDateSpinBoxTextField.text = textFromValue(value, locale);
|
||||
}
|
||||
|
||||
// We can't use JS's convenient Infinity or Number.MAX_VALUE as
|
||||
// JS Number type is 64 bits, whereas QML's int type is only 32 bits
|
||||
|
@ -758,6 +761,8 @@ Page {
|
|||
padding: 0
|
||||
background: null
|
||||
contentItem: NCInputTextField {
|
||||
id: expireDateSpinBoxTextField
|
||||
|
||||
text: expireDateSpinBox.textFromValue(expireDateSpinBox.value, expireDateSpinBox.locale)
|
||||
readOnly: !expireDateSpinBox.editable
|
||||
validator: expireDateSpinBox.validator
|
||||
|
|
Loading…
Reference in a new issue