mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-14 12:11:43 +01:00
@@ -386,7 +386,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
||||
private _matchOnLabel = true;
|
||||
private _sortByLabel = true;
|
||||
private _autoFocusOnList = true;
|
||||
private _itemActivation = ItemActivation.FIRST;
|
||||
private _itemActivation = this.ui.isScreenReaderOptimized() ? ItemActivation.NONE /* https://github.com/microsoft/vscode/issues/57501 */ : ItemActivation.FIRST;
|
||||
private _activeItems: T[] = [];
|
||||
private activeItemsUpdated = false;
|
||||
private activeItemsToConfirm: T[] | null = [];
|
||||
@@ -637,7 +637,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
||||
|
||||
private trySelectFirst() {
|
||||
if (this.autoFocusOnList) {
|
||||
if (!this.ui.isScreenReaderOptimized() && !this.canSelectMany) {
|
||||
if (!this.canSelectMany) {
|
||||
this.ui.list.focus(QuickInputListFocus.First);
|
||||
}
|
||||
}
|
||||
@@ -867,6 +867,9 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
||||
this.ui.visibleCount.setCount(this.ui.list.getVisibleCount());
|
||||
this.ui.count.setCount(this.ui.list.getCheckedCount());
|
||||
switch (this._itemActivation) {
|
||||
case ItemActivation.NONE:
|
||||
this._itemActivation = ItemActivation.FIRST; // only valid once, then unset
|
||||
break;
|
||||
case ItemActivation.SECOND:
|
||||
this.ui.list.focus(QuickInputListFocus.Second);
|
||||
this._itemActivation = ItemActivation.FIRST; // only valid once, then unset
|
||||
|
||||
@@ -183,7 +183,8 @@ export interface IQuickPickAcceptEvent {
|
||||
}
|
||||
|
||||
export enum ItemActivation {
|
||||
FIRST = 1,
|
||||
NONE,
|
||||
FIRST,
|
||||
SECOND,
|
||||
LAST
|
||||
}
|
||||
|
||||
@@ -90,7 +90,9 @@ export class QuickAccessController extends Disposable implements IQuickAccessCon
|
||||
picker.placeholder = descriptor?.placeholder;
|
||||
picker.quickNavigate = options?.quickNavigateConfiguration;
|
||||
picker.hideInput = !!picker.quickNavigate && !visibleQuickAccess; // only hide input if there was no picker opened already
|
||||
picker.itemActivation = options?.itemActivation || (options?.quickNavigateConfiguration ? ItemActivation.SECOND : ItemActivation.FIRST);
|
||||
if (typeof options?.itemActivation === 'number' || options?.quickNavigateConfiguration) {
|
||||
picker.itemActivation = options?.itemActivation ?? ItemActivation.SECOND /* quick nav is always second */;
|
||||
}
|
||||
picker.contextKey = descriptor?.contextKey;
|
||||
picker.filterValue = (value: string) => value.substring(descriptor ? descriptor.prefix.length : 0);
|
||||
if (descriptor?.placeholder) {
|
||||
|
||||
Reference in New Issue
Block a user