Skip to content

Commit

Permalink
Fix #47157 - Focus include/exclude box when toggling open
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Apr 3, 2018
1 parent 244c39c commit cf87ba3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vs/workbench/parts/search/browser/searchView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
builder.div({ 'class': 'more', 'tabindex': 0, 'role': 'button', 'title': nls.localize('moreSearch', "Toggle Search Details") })
.on(dom.EventType.CLICK, (e) => {
dom.EventHelper.stop(e);
this.toggleQueryDetails(true);
this.toggleQueryDetails();
}).on(dom.EventType.KEY_UP, (e: KeyboardEvent) => {
let event = new StandardKeyboardEvent(e);

if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
dom.EventHelper.stop(e);
this.toggleQueryDetails();
this.toggleQueryDetails(false);
}
});

Expand Down Expand Up @@ -879,7 +879,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this.onQueryChanged(true, true);
}

public toggleQueryDetails(moveFocus?: boolean, show?: boolean, skipLayout?: boolean): void {
public toggleQueryDetails(moveFocus = true, show?: boolean, skipLayout?: boolean): void {
let cls = 'more';
show = typeof show === 'undefined' ? !dom.hasClass(this.queryDetails, cls) : Boolean(show);
this.viewletSettings['query.queryDetailsExpanded'] = show;
Expand Down

0 comments on commit cf87ba3

Please sign in to comment.