提交 e7c84aab 编写于 作者: A Alex Ross

Fix privileged port elevation flow from UI

上级 61187660
......@@ -398,7 +398,7 @@ export class InputBox extends Widget {
return !!this.validation && !this.validation(this.value);
}
public validate(): boolean {
public validate(): MessageType | undefined {
let errorMsg: IMessage | null = null;
if (this.validation) {
......@@ -414,7 +414,7 @@ export class InputBox extends Widget {
}
}
return !errorMsg;
return errorMsg?.type;
}
public stylesForType(type: MessageType | undefined): { border: Color | undefined; background: Color | undefined; foreground: Color | undefined } {
......
......@@ -451,7 +451,7 @@ export class FilesRenderer implements ICompressibleTreeRenderer<ExplorerItem, Fu
}),
DOM.addStandardDisposableListener(inputBox.inputElement, DOM.EventType.KEY_DOWN, (e: IKeyboardEvent) => {
if (e.equals(KeyCode.Enter)) {
if (inputBox.validate()) {
if (!inputBox.validate()) {
done(true, true);
}
} else if (e.equals(KeyCode.Escape)) {
......
......@@ -348,15 +348,17 @@ class TunnelTreeRenderer extends Disposable implements ITreeRenderer<ITunnelGrou
inputBox,
dom.addStandardDisposableListener(inputBox.inputElement, dom.EventType.KEY_DOWN, (e: IKeyboardEvent) => {
if (e.equals(KeyCode.Enter)) {
if (inputBox.validate()) {
if (inputBox.validate() !== MessageType.ERROR) {
done(true, true);
} else {
done(false, true);
}
} else if (e.equals(KeyCode.Escape)) {
done(false, true);
}
}),
dom.addDisposableListener(inputBox.inputElement, dom.EventType.BLUR, () => {
done(inputBox.isInputValid(), true);
done(inputBox.validate() !== MessageType.ERROR, true);
}),
styler
];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册