fix: Error message is misleading when pasting bio longer than 240 chars (#14881)

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:
Roman Chornii 2024-05-29 20:59:49 +03:00 committed by GitHub
parent 527bbcc6b7
commit 11f7ae1405
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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