Skip to content

Commit

Permalink
Fixed QuickInput behavior on Enter
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Bozzini <federico.bozzini@gmail.com>
  • Loading branch information
federicobozzini authored and arekzaluski committed Feb 1, 2023
1 parent d1f5719 commit 6a029ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/monaco/src/browser/monaco-quick-input-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ export class MonacoQuickInputService implements QuickInputService {
options.onDidAccept();
}
wrapped.hide();
resolve(wrapped.selectedItems[0]);
const firstSelectedElement = wrapped.selectedItems[0];
const firstElement = wrapped.items.find(i => !QuickPickSeparator.is(i)) as T | undefined;
const result = firstSelectedElement || firstElement;
resolve(result);
});

wrapped.onDidHide(() => {
Expand Down

0 comments on commit 6a029ec

Please sign in to comment.