提交 64005c3d 编写于 作者: B Benjamin Pasero

more focus behavior polish

上级 699f0946
......@@ -261,8 +261,10 @@ export class CollapseAction extends Action {
}
viewer.collapseAll();
viewer.clearSelection(); // Chance is high that element is now hidden, so unselect all
viewer.DOMFocus(); // Pass keyboard focus back from action link to tree
viewer.clearSelection();
viewer.clearFocus();
viewer.DOMFocus();
viewer.focusFirst();
return TPromise.as(null);
});
......
......@@ -140,6 +140,7 @@
.monaco-shell input[type="button"]:active,
.monaco-shell input[type="submit"]:active,
.monaco-shell input[type="checkbox"]:active,
.monaco-shell .monaco-tree .monaco-tree-row .monaco-action-bar .action-item [tabindex="0"]:hover,
.monaco-shell .monaco-tree.focused.no-item-focus:active:before {
outline: 0 !important; /* fixes some flashing outlines from showing up when clicking */
}
......
......@@ -1391,6 +1391,8 @@ export class RefreshViewExplorerAction extends Action {
return TPromise.as(null); // Global action disabled if user is in edit mode from another action
}
explorerView.focusBody();
return explorerView.refresh(true, true, true);
});
}
......
......@@ -309,7 +309,6 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
if (this.visible && this.tree.getSelection().indexOf(status) === -1) {
return this.tree.reveal(status, 0.5).then(() => {
this.tree.setSelection([status], { origin: 'implicit' });
this.tree.setFocus(status);
});
}
......
......@@ -46,12 +46,17 @@ export class ToggleOutputAction extends Action {
export class ClearOutputAction extends Action {
constructor(@IOutputService private outputService: IOutputService) {
constructor(
@IOutputService private outputService: IOutputService,
@IPanelService private panelService: IPanelService
) {
super('workbench.output.action.clearOutput', nls.localize('clearOutput', "Clear Output"), 'output-action clear-output');
}
public run(): Promise {
this.outputService.clearOutput(this.outputService.getActiveChannel());
this.panelService.getActivePanel().focus();
return TPromise.as(true);
}
}
......
......@@ -380,9 +380,15 @@ export class CollapseAllAction extends Action {
}
public run(): Promise {
if (this.viewlet.getControl()) {
return this.viewlet.getControl().collapseAll();
let tree = this.viewlet.getControl();
if (tree) {
tree.collapseAll();
tree.clearSelection();
tree.clearFocus();
tree.DOMFocus();
tree.focusFirst();
}
return TPromise.as(null);
}
}
......@@ -743,7 +749,7 @@ export class SearchViewlet extends Viewlet {
};
this.queryBox = builder.div({ 'class': 'query-box' }, (div) => {
let options:IFindInputOptions = {
let options: IFindInputOptions = {
label: nls.localize('label.Search', 'Search: Type Search Term and press Enter to search or Escape to cancel'),
validation: (value: string) => {
if (value.length === 0) {
......@@ -889,8 +895,8 @@ export class SearchViewlet extends Viewlet {
controller: new SearchController(),
accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider)
}, {
ariaLabel: nls.localize('treeAriaLabel', "Search Results")
});
ariaLabel: nls.localize('treeAriaLabel', "Search Results")
});
this.toUnbind.push(() => renderer.dispose());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册