Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions ts/a11y/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ export function ExplorerMathDocumentMixin<
brailleCombine: false, // combine Braille with speech output
help: true, // include "press h for help" messages on focus
roleDescription: 'math', // the role description to use for math expressions
inTabOrder: true, // true if expressin get tabindex = 0
tabSelects: 'all', // 'all' for whole expression, 'last' for last explored node
}
};
Expand Down
13 changes: 10 additions & 3 deletions ts/a11y/explorer/KeyExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ export class SpeechExplorer
if (this.img) {
this.node.append(this.img);
}
this.node.setAttribute('tabindex', '0');
this.node.setAttribute('tabindex', this.tabIndex);
}
}

Expand Down Expand Up @@ -1903,13 +1903,20 @@ export class SpeechExplorer
this.magnifyRegion.Update(this.current);
}

/**
* @returns {string} The tabIndex to use when not exploring
*/
protected get tabIndex(): string {
return this.document.options.a11y.inTabOrder ? '0' : '-1';
}

/**
* @override
*/
public Attach() {
if (this.attached) return;
super.Attach();
this.node.setAttribute('tabindex', '0');
this.node.setAttribute('tabindex', this.tabIndex);
this.attached = true;
}

Expand All @@ -1923,7 +1930,7 @@ export class SpeechExplorer
this.node.removeAttribute('aria-label');
this.img?.remove();
if (this.active) {
this.node.setAttribute('tabindex', '0');
this.node.setAttribute('tabindex', this.tabIndex);
}
this.attached = false;
}
Expand Down
6 changes: 3 additions & 3 deletions ts/ui/menu/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export interface MenuSettings {
autocollapse: boolean;
collapsible: boolean;
enrich: boolean;
inTabOrder: boolean;
assistiveMml: boolean;
// A11y settings
backgroundColor: string;
Expand All @@ -99,6 +98,7 @@ export interface MenuSettings {
infoPrefix: boolean;
infoRole: boolean;
infoType: boolean;
inTabOrder: boolean;
locale: string;
magnification: string;
magnify: string;
Expand Down Expand Up @@ -153,7 +153,6 @@ export class Menu {
autocollapse: false,
collapsible: false,
enrich: true,
inTabOrder: true,
assistiveMml: false,
speech: true,
braille: true,
Expand All @@ -162,6 +161,7 @@ export class Menu {
brailleCombine: false,
speechRules: 'clearspeak-default',
roleDescription: 'math',
inTabOrder: true,
tabSelects: 'all',
help: true,
},
Expand Down Expand Up @@ -669,7 +669,7 @@ export class Menu {
this.variable<boolean>('enrich', (enrich) =>
this.setEnrichment(enrich)
),
this.variable<boolean>('inTabOrder', (tab) => this.setTabOrder(tab)),
this.a11yVar<boolean>('inTabOrder', (tab) => this.setTabOrder(tab)),
this.a11yVar<string>('tabSelects'),
this.variable<boolean>('assistiveMml', (mml) =>
this.setAssistiveMml(mml)
Expand Down