Browse Source

When getting active focus textinput value was being cleared. However if text was inputted then this would stay between active focus states.

This commit forces the value to be assigned the value in the textInput when active focus is given.

CURA-8640
j.delarago 2 years ago
parent
commit
e593322b43
1 changed files with 7 additions and 1 deletions
  1. 7 1
      resources/qml/Settings/SettingTextField.qml

+ 7 - 1
resources/qml/Settings/SettingTextField.qml

@@ -162,6 +162,13 @@ SettingItem
                 property: "text"
                 value:
                 {
+                    if (input.activeFocus)
+                    {
+                        // In QT6 using "when: !activeFocus" causes the value to be null when activeFocus becomes True
+                        // Since we want the value to stay the same when giving focus to the TextInput this is being used
+                        // in place of "when: !activeFocus"
+                        return input.text
+                    }
                     // Stacklevels
                     // 0: user  -> unsaved change
                     // 1: quality changes  -> saved change
@@ -181,7 +188,6 @@ SettingItem
                         return propertyProvider.properties.value
                     }
                 }
-                when: !input.activeFocus
             }
 
             MouseArea