Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ts/a11y/explorer/KeyExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1941,10 +1941,29 @@ export class SpeechExplorer
public AddEvents() {
if (!this.eventsAttached) {
super.AddEvents();
this.addHtmlEvents();
this.eventsAttached = true;
}
}

/**
* Prevent clicks in mjx-html nodes from propagating, so clicks in
* HTML input elements or other selectable nodes will stop
* the explorer from processing the click.
*/
protected addHtmlEvents() {
for (const html of Array.from(this.node.querySelectorAll('mjx-html'))) {
const stop = (event: Event) => {
if (html.contains(document.activeElement)) {
event.stopPropagation();
}
};
html.addEventListener('click', stop);
html.addEventListener('keydown', stop);
html.addEventListener('dblclick', stop);
}
}

/********************************************************************/
/*
* Actions and links
Expand Down