Skip to content
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

fix(ADA-16): Transcript search results inaccessible to screen reader #164

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion src/components/caption-list/captionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ export class CaptionList extends Component<Props> {

render() {
const {data} = this.props;
let isSearchCaption = false;
Tzipi-kaltura marked this conversation as resolved.
Show resolved Hide resolved
return (
<div className={styles.transcriptWrapper} onKeyUp={this._handleKeyUp} aria-live="polite">
{data.map((captionData, index) => {
const captionProps = this._getCaptionProps(captionData);
const searchCaption = this.props.searchMap[captionData.id];
return (
<Caption
ref={node => {
Expand All @@ -116,7 +118,15 @@ export class CaptionList extends Component<Props> {
} else if (index === data.length - 1) {
this._lastCaptionRef = node;
}
if (captionProps.highlighted[captionData.id]) {
if (searchCaption){
Object.keys(searchCaption).forEach(key => {
if (parseInt(key) === this.props.activeSearchIndex) {
this._currentCaptionRef = node
isSearchCaption = true;
}
});
}
if (!isSearchCaption && captionProps.highlighted[captionData.id]) {
this._currentCaptionRef = node;
}
}}
Expand Down
Loading