fix: create channel popup create button was enabled always

Fixed create button to be disabled when name and description
text fields are empty in create channel popup

Closes #4444
This commit is contained in:
Alexandra Betouni 2022-01-13 22:48:03 +02:00 committed by Sale Djenic
parent 2ff5ce7fc2
commit f861be5526
1 changed files with 4 additions and 2 deletions

View File

@ -41,8 +41,8 @@ StatusModal {
onClosed: destroy()
function isFormValid() {
return contentItem.channelName.valid &&
contentItem.channelDescription.valid
return (scrollView.channelName.valid &&
scrollView.channelDescription.valid)
}
contentItem: ScrollView {
@ -77,6 +77,7 @@ StatusModal {
input.text = Utils.convertSpacesToDashesAndUpperToLowerCase(input.text);
input.cursorPosition = input.text.length
}
validationMode: StatusInput.ValidationMode.Always
validators: [StatusMinLengthValidator {
minLength: 1
errorMessage: Utils.getErrorMessage(nameInput.errors, qsTr("channel name"))
@ -96,6 +97,7 @@ StatusModal {
input.placeholderText: qsTr("Describe the channel")
input.multiline: true
input.implicitHeight: 88
validationMode: StatusInput.ValidationMode.Always
validators: [StatusMinLengthValidator {
minLength: 1
errorMessage: Utils.getErrorMessage(descriptionTextArea.errors, qsTr("channel description"))