Skip to content

Commit 189fc04

Browse files
authored
Merge pull request #223 from pie-framework/feat/PD-153
feat: includeSrHeading prop to pie-player for heading control PIE-153
2 parents a19d8f9 + 899cbdc commit 189fc04

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

src/components.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ export namespace Components {
155155
*/
156156
'hosted'?: boolean;
157157
/**
158+
* Whether to inject a visually-hidden (screen-reader-only) heading at the top of the player's rendered content. Set to `false` in contexts where an SR heading would be redundant or counter-indicated (e.g. the player is already labelled by a surrounding landmark, or the host page manages its own heading structure). Defaults to `true` so that assistive-technology users get a navigable heading out of the box.
159+
*/
160+
'includeSrHeading': boolean;
161+
/**
158162
* The Pie loader config.
159163
*/
160164
'loaderConfig': LoaderConfig;
@@ -378,6 +382,10 @@ declare namespace LocalJSX {
378382
*/
379383
'hosted'?: boolean;
380384
/**
385+
* Whether to inject a visually-hidden (screen-reader-only) heading at the top of the player's rendered content. Set to `false` in contexts where an SR heading would be redundant or counter-indicated (e.g. the player is already labelled by a surrounding landmark, or the host page manages its own heading structure). Defaults to `true` so that assistive-technology users get a navigable heading out of the box.
386+
*/
387+
'includeSrHeading'?: boolean;
388+
/**
381389
* The Pie loader config.
382390
*/
383391
'loaderConfig'?: LoaderConfig;

src/components/pie-player/pie-player.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,18 @@ export class Player {
221221
*/
222222
@Prop() baseHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
223223

224+
/**
225+
* Whether to inject a visually-hidden (screen-reader-only) heading at the
226+
* top of the player's rendered content.
227+
*
228+
* Set to `false` in contexts where an SR heading would be redundant or
229+
* counter-indicated (e.g. the player is already labelled by a surrounding
230+
* landmark, or the host page manages its own heading structure).
231+
* Defaults to `true` so that assistive-technology users get a navigable
232+
* heading out of the box.
233+
*/
234+
@Prop() includeSrHeading: boolean = true;
235+
224236
pieLoader = new PieLoader(null, this.loaderConfig);
225237
private loadingStyles = new Set<string>();
226238

@@ -724,7 +736,8 @@ export class Player {
724736
addCorrectResponse: this.addCorrectResponse,
725737
reFetchBundle: this.reFetchBundle,
726738
customClassname: this.customClassname,
727-
baseHeadingLevel: this.baseHeadingLevel
739+
baseHeadingLevel: this.baseHeadingLevel,
740+
includeSrHeading: this.includeSrHeading
728741
};
729742

730743
if (this.renderStimulus) {

0 commit comments

Comments
 (0)