Skip to content

Commit bc11aba

Browse files
committed
Add option to disable explorer help
1 parent d3ef2f0 commit bc11aba

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

ts/a11y/explorer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ export function ExplorerMathDocumentMixin<
321321
public static OPTIONS: OptionList = {
322322
...BaseDocument.OPTIONS,
323323
enableExplorer: hasWindow, // only activate in interactive contexts
324+
enableExplorerHelp: true, // help dialog is enabled
324325
renderActions: expandable({
325326
...BaseDocument.OPTIONS.renderActions,
326327
explorable: [STATE.EXPLORER]

ts/a11y/explorer/KeyExplorer.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,13 @@ export class SpeechExplorer
619619

620620
/**
621621
* Open the help dialog, and refocus when it closes.
622+
*
623+
* @returns {boolean | void} True cancels the event
622624
*/
623-
protected hKey() {
625+
protected hKey(): boolean | void {
626+
if (!this.document.options.enableExplorerHelp) {
627+
return true;
628+
}
624629
this.refocus = this.current;
625630
this.help();
626631
}
@@ -1072,7 +1077,7 @@ export class SpeechExplorer
10721077
if (describe) {
10731078
let description =
10741079
this.description === this.none ? '' : ', ' + this.description;
1075-
if (this.document.options.a11y.help) {
1080+
if (this.document.options.a11y.help && this.document.options.enableExplorerHelp) {
10761081
description += ', press h for help';
10771082
}
10781083
speech += description;
@@ -1548,7 +1553,9 @@ export class SpeechExplorer
15481553
// and add the info icon.
15491554
//
15501555
this.node.classList.add('mjx-explorer-active');
1551-
this.node.append(this.document.infoIcon);
1556+
if (this.document.options.enableExplorerHelp) {
1557+
this.node.append(this.document.infoIcon);
1558+
}
15521559
//
15531560
// Get the node to make current, and determine if we need to add a
15541561
// speech node (or just use the top-level node), then set the
@@ -1584,7 +1591,9 @@ export class SpeechExplorer
15841591
this.node.setAttribute('aria-roledescription', description);
15851592
}
15861593
this.node.classList.remove('mjx-explorer-active');
1587-
this.document.infoIcon.remove();
1594+
if (this.document.options.enableExplorerHelp) {
1595+
this.document.infoIcon.remove();
1596+
}
15881597
this.pool.unhighlight();
15891598
this.magnifyRegion.Hide();
15901599
this.region.Hide();

ts/ui/menu/MenuHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export function MenuMathDocumentMixin<B extends A11yDocumentConstructor>(
201201
enableSpeech: true,
202202
enableBraille: true,
203203
enableExplorer: true,
204+
enableExplorerHelp: true,
204205
enrichSpeech: 'none',
205206
enrichError: (_doc: MenuMathDocument, _math: MenuMathItem, err: Error) =>
206207
console.warn('Enrichment Error:', err),

0 commit comments

Comments
 (0)