Skip to content

Commit

Permalink
Fix focus behavior (#49340)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed Jun 20, 2018
1 parent 0a35cbf commit edb49f6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/vs/workbench/browser/parts/quickinput/quickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,12 @@ export class QuickInputService extends Component implements IQuickInputService {
break;
case KeyCode.Tab:
if (!event.altKey && !event.ctrlKey && !event.metaKey) {
const inputs = [].slice.call(container.querySelectorAll('input'))
.filter(input => input.style.display !== 'none');
const inputs = [].slice.call(container.querySelectorAll('.action-label.icon'));
if (container.classList.contains('show-checkboxes')) {
inputs.push(...[].slice.call(container.querySelectorAll('input')));
} else {
inputs.push(...[].slice.call(container.querySelectorAll('input[type=text]')));
}
if (event.shiftKey && event.target === inputs[0]) {
dom.EventHelper.stop(e, true);
inputs[inputs.length - 1].focus();
Expand Down Expand Up @@ -1062,7 +1066,7 @@ export class QuickInputService extends Component implements IQuickInputService {
(item as ActionItem).getAction().enabled = enabled;
}
this.ui.checkAll.disabled = !enabled;
this.ui.inputBox.enabled = enabled;
// this.ui.inputBox.enabled = enabled; Avoid loosing focus.
this.ok.enabled = enabled;
this.ui.list.enabled = enabled;
}
Expand Down

0 comments on commit edb49f6

Please sign in to comment.