mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 02:02:35 -05:00
fix keyboard issues in task and explorer widgets (#1064)
This commit is contained in:
@@ -31,6 +31,8 @@ import * as DOM from 'vs/base/browser/dom';
|
||||
import { CommandsRegistry, ICommand } from 'vs/platform/commands/common/commands';
|
||||
import { MenuRegistry, ICommandAction } from 'vs/platform/actions/common/actions';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
|
||||
interface ITask {
|
||||
name: string;
|
||||
@@ -135,7 +137,15 @@ export class TasksWidget extends DashboardWidget implements IDashboardWidget, On
|
||||
}
|
||||
innerTile.append(label);
|
||||
tile.append(innerTile);
|
||||
tile.attr('tabindex', '0');
|
||||
tile.on(DOM.EventType.CLICK, () => this.runTask(action));
|
||||
tile.on(DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
let event = new StandardKeyboardEvent(e);
|
||||
if (event.equals(KeyCode.Enter)) {
|
||||
this.runTask(action);
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
});
|
||||
return tile.getHTMLElement();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user