diff --git a/src/sql/workbench/browser/modelComponents/inputbox.component.ts b/src/sql/workbench/browser/modelComponents/inputbox.component.ts index de943ee708..166f5dfb67 100644 --- a/src/sql/workbench/browser/modelComponents/inputbox.component.ts +++ b/src/sql/workbench/browser/modelComponents/inputbox.component.ts @@ -64,7 +64,7 @@ export default class InputBoxComponent extends ComponentBase { if (checkOption()) { this.value = input.value; + input.hideErrors = false; await this.validate(); - if (input.hideErrors) { - input.hideErrors = false; - } this.fireEvent({ eventType: ComponentEventType.onDidChange, args: e @@ -159,17 +157,14 @@ export default class InputBoxComponent extends ComponentBase { - let valid = await super.validate(); - const otherErrorMsg = valid || this.inputElement.value === '' ? undefined : this.validationErrorMessage; - valid = valid && this.inputElement.validate(); + await super.validate(); + // Let the input validate handle showing/hiding the error message + const valid = this.inputElement.validate(); // set aria label based on validity of input if (valid) { this.inputElement.setAriaLabel(this.ariaLabel); } else { - if (otherErrorMsg) { - this.inputElement.showMessage({ type: MessageType.ERROR, content: otherErrorMsg }, true); - } if (this.ariaLabel) { this.inputElement.setAriaLabel(nls.localize('period', "{0}. {1}", this.ariaLabel, this.inputElement.inputElement.validationMessage)); } else {