Improve hover accessibility (#167749)

- Search entire hover container when adding focus trap
- Change keyup to keydown event to activate hover action links properly
This commit is contained in:
Raymond Zhao
2022-11-30 09:50:54 -08:00
committed by GitHub
parent c5be23af01
commit 959c8b024c
2 changed files with 3 additions and 3 deletions

View File

@@ -72,9 +72,9 @@ export class HoverAction extends Disposable {
actionOptions.run(this.actionContainer);
}));
this._register(dom.addDisposableListener(this.actionContainer, dom.EventType.KEY_UP, e => {
this._register(dom.addDisposableListener(this.actionContainer, dom.EventType.KEY_DOWN, e => {
const event = new StandardKeyboardEvent(e);
if (event.equals(KeyCode.Enter)) {
if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
e.stopPropagation();
e.preventDefault();
actionOptions.run(this.actionContainer);