diff --git a/nymea-app/ui/delegates/ParamDelegate.qml b/nymea-app/ui/delegates/ParamDelegate.qml index 8d33a4d1..c488f9f9 100644 --- a/nymea-app/ui/delegates/ParamDelegate.qml +++ b/nymea-app/ui/delegates/ParamDelegate.qml @@ -10,7 +10,7 @@ ItemDelegate { property ParamType paramType: null property alias value: d.value - property var param: Param { + property Param param: Param { id: d paramTypeId: paramType.id value: paramType.defaultValue @@ -163,10 +163,19 @@ ItemDelegate { Component { id: textFieldComponent TextField { - text: root.param.value + text: root.param.value !== undefined + ? root.param.value + : root.paramType.defaultValue + ? root.paramType.defaultValue + : "" onEditingFinished: { root.param.value = text } + Component.onCompleted: { + if (root.param.value === undefined) { + root.param.value = text; + } + } } }