From 1a79bb16d3344235dc1b75ff1de96d922ad9b43c Mon Sep 17 00:00:00 2001 From: zorkow Date: Thu, 22 Apr 2021 12:55:25 +0100 Subject: [PATCH] Clicking per mouse event. --- ts/a11y/explorer/KeyExplorer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts/a11y/explorer/KeyExplorer.ts b/ts/a11y/explorer/KeyExplorer.ts index e5abd289b..2e6946dad 100644 --- a/ts/a11y/explorer/KeyExplorer.ts +++ b/ts/a11y/explorer/KeyExplorer.ts @@ -304,6 +304,7 @@ export class SpeechExplorer extends AbstractKeyExplorer { /** * Programmatically triggers a link if the focused node contains one. + * @param {number} code The keycode of the last key pressed. */ protected triggerLink(code: number) { if (code !== 13) { @@ -314,8 +315,7 @@ export class SpeechExplorer extends AbstractKeyExplorer { getAttribute('data-semantic-postfix')?. match(/(^| )link($| )/); if (focus) { - // Works for CHTML only. - node.parentElement.click(); + node.parentNode.dispatchEvent(new MouseEvent('click')); return true; } return false;