Skip to content

Commit

Permalink
Revert "fix(ADA-1064): Transcript search results inaccessible to scre…
Browse files Browse the repository at this point in the history
…en reader followup from ADA-16 (#211)"

This reverts commit 46c6dcd.
  • Loading branch information
semarche-kaltura committed Aug 1, 2024
1 parent 944511a commit 06fb8b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
34 changes: 3 additions & 31 deletions src/components/caption-list/captionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ import {HOUR} from '../../utils';
import {Caption} from '../caption';
import * as styles from './captionList.scss';
import {HighlightedMap, CuePointData} from '../../types';
import {TranscriptEvents} from "../../events/events";
import {ui} from "@playkit-js/kaltura-player-js";

const {END, HOME} = KalturaPlayer.ui.utils.KeyMap;
const {withEventManager} = KalturaPlayer.ui.Event;
const {withPlayer} = ui.Components;

export interface CaptionProps {
showTime: boolean;
Expand All @@ -32,35 +28,20 @@ export interface Props {
activeSearchIndex: number;
searchMap: Record<string, Record<string, number>>;
captionProps: CaptionProps;
eventManager?: any;
player?: any;
}


@withEventManager
@withPlayer
export class CaptionList extends Component<Props> {
private _currentCaptionRef: any = null;
private _firstCaptionRef: any = null;
private _lastCaptionRef: any = null;
private _isTranscriptNavigateTriggered: boolean = false;

constructor(props: Props | undefined) {
super(props);
this._setFocus();
}

shouldComponentUpdate(nextProps: Readonly<Props>) {
const {highlightedMap, data, searchMap, activeSearchIndex, isAutoScrollEnabled} = this.props;
if (searchMap !== nextProps.searchMap){
this._isTranscriptNavigateTriggered = false;
}
const {highlightedMap, data, searchMap, activeSearchIndex, isAutoScrollEnabled, captionProps} = this.props;
if (
highlightedMap !== nextProps.highlightedMap ||
data !== nextProps.data ||
searchMap !== nextProps.searchMap ||
activeSearchIndex !== nextProps.activeSearchIndex ||
isAutoScrollEnabled !== nextProps.isAutoScrollEnabled
isAutoScrollEnabled !== nextProps.isAutoScrollEnabled ||
captionProps.videoDuration !== nextProps.captionProps.videoDuration
) {
return true;
}
Expand Down Expand Up @@ -122,12 +103,6 @@ export class CaptionList extends Component<Props> {
}
};

private _setFocus = () =>{
this.props.eventManager?.listen(this.props.player, TranscriptEvents.TRANSCRIPT_NAVIGATE_RESULT, () => {
this._isTranscriptNavigateTriggered = true
});
}

render() {
const {data} = this.props;
let isSearchCaption = false;
Expand All @@ -151,9 +126,6 @@ export class CaptionList extends Component<Props> {
}
});
}
if (this._isTranscriptNavigateTriggered && isSearchCaption){
this._currentCaptionRef?.base?.focus();
}
if (!isSearchCaption && captionProps.highlighted[captionData.id]) {
this._currentCaptionRef = node;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/transcript/transcript.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
font-style: normal;
}

*:focus:not(input) {
*:focus-visible:not(input) {
outline: 1px solid $tab-focus-color;
}
}
Expand Down

0 comments on commit 06fb8b6

Please sign in to comment.