Skip to content

Commit

Permalink
fix(ADA-21): Pressing escape anywhere in the transcript area causes t…
Browse files Browse the repository at this point in the history
…he transcript to be hidden
  • Loading branch information
Tzipi-kaltura committed Nov 16, 2023
1 parent 714996f commit 08b6711
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
9 changes: 0 additions & 9 deletions cypress/e2e/transcript.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ describe('Transcript plugin', () => {
cy.get('[aria-label="Dark Side."]').should('have.text', 'Dark Side.');
});
});

it('should close plugin if ESC button pressed', () => {
mockKalturaBe();
loadPlayer().then(() => {
cy.get('[data-testid="transcript_root"]').should('have.css', 'visibility', 'visible');
cy.get('[aria-label="Search in Transcript"]').get('input').type('{esc}');
cy.get('[data-testid="transcript_root"]').should('have.css', 'visibility', 'hidden');
});
});
});

describe('search bar', () => {
Expand Down
9 changes: 1 addition & 8 deletions src/components/transcript/transcript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {SmallScreenSlate} from '../small-screen-slate';
import {Button, ButtonType, ButtonSize} from '@playkit-js/common/dist/components/button';
import {OnClickEvent, OnClick} from '@playkit-js/common/dist/hoc/a11y-wrapper';

const {ENTER, SPACE, TAB, ESC} = ui.utils.KeyMap;
const {ENTER, SPACE, TAB} = ui.utils.KeyMap;
const {withText, Text} = ui.preacti18n;

const {SidePanelModes} = ui;
Expand Down Expand Up @@ -372,12 +372,6 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
onActiveSearchIndexChange: debounce(this._setActiveSearchIndex, this.props.searchNextPrevDebounceTimeout)
};

private _handleEsc = (event: KeyboardEvent) => {
if (event.keyCode === ESC) {
this.props.onClose(event, true);
}
};

render(props: TranscriptProps) {
const {isLoading, kitchenSinkActive, hasError, smallScreen, toggledWithEnter} = props;
const renderTranscriptButtons = !(isLoading || hasError);
Expand All @@ -387,7 +381,6 @@ export class Transcript extends Component<TranscriptProps, TranscriptState> {
ref={node => {
this._widgetRootRef = node;
}}
onKeyUp={this._handleEsc}
data-testid="transcript_root">
{smallScreen ? (
<SmallScreenSlate onClose={this.props.onClose} toggledWithEnter={toggledWithEnter} />
Expand Down

0 comments on commit 08b6711

Please sign in to comment.