Allow showing error without field focusing.
This commit is contained in:
parent
ba1c7d8d31
commit
84d68e48c0
2 changed files with 6 additions and 1 deletions
|
|
@ -3506,12 +3506,16 @@ void InputField::setEditLinkCallback(
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputField::showError() {
|
void InputField::showError() {
|
||||||
setErrorShown(true);
|
showErrorNoFocus();
|
||||||
if (!hasFocus()) {
|
if (!hasFocus()) {
|
||||||
_inner->setFocus();
|
_inner->setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InputField::showErrorNoFocus() {
|
||||||
|
setErrorShown(true);
|
||||||
|
}
|
||||||
|
|
||||||
void InputField::setErrorShown(bool error) {
|
void InputField::setErrorShown(bool error) {
|
||||||
if (_error != error) {
|
if (_error != error) {
|
||||||
_error = error;
|
_error = error;
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,7 @@ public:
|
||||||
const TextWithTags &value = TextWithTags());
|
const TextWithTags &value = TextWithTags());
|
||||||
|
|
||||||
void showError();
|
void showError();
|
||||||
|
void showErrorNoFocus();
|
||||||
|
|
||||||
void setMaxLength(int maxLength);
|
void setMaxLength(int maxLength);
|
||||||
void setMinHeight(int minHeight);
|
void setMinHeight(int minHeight);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue