Fix custom UI validation bugs (#1583)

This commit is contained in:
Matt Irvine
2018-06-08 15:32:21 -07:00
committed by GitHub
parent 02af7e9299
commit 20c4f085c8
3 changed files with 17 additions and 3 deletions

View File

@@ -364,7 +364,11 @@ export class InputBox extends Widget {
};
}
if (!errorMsg) {
if (errorMsg) {
this.inputElement.setAttribute('aria-invalid', 'true');
this.showMessage(errorMsg);
}
else if (this.inputElement.hasAttribute('aria-invalid')) {
this.inputElement.removeAttribute('aria-invalid');
this.hideMessage();
}