diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index fabd4caad3..358e8b9ef5 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -41,7 +41,13 @@ UM.Dialog selectByMouse: true anchors.top: colorLabel.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{6})$/ } + onTextChanged: { + if (!text.startsWith("#")) + { + text = `#${text}`; + } + } + validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ } } Rectangle