-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triggering links from the explorer. #687
Conversation
ts/a11y/explorer/KeyExplorer.ts
Outdated
match(/(^| )link($| )/); | ||
if (focus) { | ||
// Works for CHTML only. | ||
node.parentElement.click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW in the light walker, I basically set window.location.href to the href I get from the link.
It looks like node.parentNode.dispatchEvent(new MouseEvent('click')); works for me, at least in Firefox (provided |
Thanks. I was clearly in the keyboard zone, as I had also experimented with |
This is now ready for review. |
PS: This is the first time I am using optional chaining in MathJax code, as @pkra suggested it the other day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'll merge.
Hitting return on the node that announces itself to be a link will trigger the link.
Unfortunately, this only works for CHTML, not in SVG.
I've tried by setting focus on the anchor element and continue propagating the event.
Unfortunately, that only works sporadically.
Also dispatching a new event like below did not do the trick.