diff --git a/src/StatusQ/Controls/StatusBaseInput.qml b/src/StatusQ/Controls/StatusBaseInput.qml index cdd2e765..246b1a10 100644 --- a/src/StatusQ/Controls/StatusBaseInput.qml +++ b/src/StatusQ/Controls/StatusBaseInput.qml @@ -182,9 +182,9 @@ Item { /*! \qmlproperty bool StatusBaseInput::valid - This property sets the valid state. Default value is true. + This property sets the valid state. Default value is false. */ - property bool valid: true + property bool valid: false /*! \qmlproperty bool StatusBaseInput::pristine This property sets the pristine. Default value is true. diff --git a/src/StatusQ/Controls/StatusInput.qml b/src/StatusQ/Controls/StatusInput.qml index c763d26b..a6fa4d5f 100644 --- a/src/StatusQ/Controls/StatusInput.qml +++ b/src/StatusQ/Controls/StatusInput.qml @@ -48,6 +48,7 @@ Item { This property holds a reference to the TextEdit's valid property. */ property alias valid: statusBaseInput.valid + /*! \qmlproperty alias StatusInput::pending This property holds a reference to the TextEdit's pending property. @@ -243,7 +244,7 @@ Item { This function resets the text input validation and text. */ function reset() { - statusBaseInput.valid = true + statusBaseInput.valid = false statusBaseInput.pristine = true statusBaseInput.text = "" root.errorMessage = "" @@ -276,8 +277,12 @@ Item { valid: result } } - result.errorMessage = validator.errorMessage errors[validator.name] = result + + // the only way to trigger bindings for var property + errors = errors + result.errorMessage = validator.errorMessage + statusBaseInput.valid = statusBaseInput.valid && false } }