fix: Error message is misleading when pasting bio longer than 240 chars

de-synchronized charLimit and input.maximumLength for Profile Description bio properties to get the UX identical to mobile.
Fixes: #14879
This commit is contained in:
Seitseman 2024-05-22 13:42:07 +03:00 committed by Jonathan Rainville
parent bcb9d787c8
commit 70bdd9140f
1 changed files with 9 additions and 0 deletions

View File

@ -48,15 +48,24 @@ Item {
label: qsTr("Bio")
placeholderText: qsTr("Tell us about yourself")
input.maximumLength : 32767
charLimit: 240
multiline: true
minimumHeight: 108
maximumHeight: 108
input.verticalAlignment: TextEdit.AlignTop
validators: [
StatusValidator {
name: "maxLengthValidator"
validate: function (t) { return t.length <= bioInput.charLimit}
errorMessage: qsTr("Bio cant be longer than %n character(s)", "", bioInput.charLimit)
},
StatusRegularExpressionValidator {
regularExpression: Constants.regularExpressions.asciiWithEmoji
errorMessage: qsTr("Invalid characters. Standard keyboard characters and emojis only.")
validate: function (value) {
return (regularExpression.test(value) || (value.length === 0));
}
}
]
input.tabNavItem: displayNameInput.input.edit