fix the input box validation (#15634)

* fix the input box validation

* fix one more place
This commit is contained in:
Alan Ren
2021-06-08 14:24:50 -07:00
committed by GitHub
parent a61462a2c0
commit d91660b66f
9 changed files with 23 additions and 24 deletions

View File

@@ -425,7 +425,7 @@ export class InputBox extends Widget {
return !!this.validation && !this.validation(this.value);
}
public validate(): boolean { // {{SQL CARBON EDIT}}
public validate(): MessageType | undefined {
let errorMsg: IMessage | null = null;
if (this.validation) {
@@ -449,8 +449,7 @@ export class InputBox extends Widget {
}
}
// {{SQL CARBON EDIT}} Candidate for addition to vscode
return errorMsg ? errorMsg.type !== MessageType.ERROR : true;
return errorMsg?.type;
}
public stylesForType(type: MessageType | undefined): { border: Color | undefined; background: Color | undefined; foreground: Color | undefined } {