Skip to content

Commit f20fe4d

Browse files
authored
Typing ".." in the (simple) Open File dialog has strange behaviour (microsoft#235746)
Fixes microsoft#154642
1 parent f43f3cc commit f20fe4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,8 @@ export class SimpleFileDialog extends Disposable implements ISimpleFileDialog {
862862
private async updateItems(newFolder: URI, force: boolean = false, trailing?: string): Promise<boolean> {
863863
this.busy = true;
864864
this.autoCompletePathSegment = '';
865+
const wasDotDot = trailing === '..';
866+
trailing = wasDotDot ? undefined : trailing;
865867
const isSave = !!trailing;
866868
let result = false;
867869

@@ -892,7 +894,7 @@ export class SimpleFileDialog extends Disposable implements ISimpleFileDialog {
892894
this.filePickBox.items = items;
893895

894896
// the user might have continued typing while we were updating. Only update the input box if it doesn't match the directory.
895-
if (!equalsIgnoreCase(this.filePickBox.value, newValue) && force) {
897+
if (!equalsIgnoreCase(this.filePickBox.value, newValue) && (force || wasDotDot)) {
896898
this.filePickBox.valueSelection = [0, this.filePickBox.value.length];
897899
this.insertText(newValue, newValue);
898900
}

0 commit comments

Comments
 (0)