Skip to content

Commit

Permalink
fix(ADA-467): Focus continues in all page rather than staying within …
Browse files Browse the repository at this point in the history
…info dialog.
  • Loading branch information
Tzipi-kaltura committed Jan 30, 2024
1 parent 5ceef15 commit ef78c8e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/components/info/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const {
} = KalturaPlayer.ui;
const {Overlay} = KalturaPlayer.ui.components;
const {Text} = KalturaPlayer.ui.preacti18n;
// @ts-ignore
const {withKeyboardA11y} = KalturaPlayer.ui.utils;

export interface InfoProps {
onClick: () => void;
Expand All @@ -20,13 +22,19 @@ export interface InfoProps {
interface ConnectProps {
playerSize?: string;
}
interface KeyboardA11yProps {
handleKeyDown?: () => void;
setIsModal?: (isModel: boolean) => void;
addAccessibleChild?: (element: HTMLElement) => void;
}

type MergedProps = InfoProps & ConnectProps;
type MergedProps = InfoProps & ConnectProps & KeyboardA11yProps;

const mapStateToProps = (state: Record<string, any>) => ({
playerSize: state.shell.playerSize
});
@connect(mapStateToProps)
@withKeyboardA11y
export class Info extends Component<MergedProps> {
renderMediaInfo = () => {
const {creator, createdAt, plays} = this.props;
Expand All @@ -53,14 +61,18 @@ export class Info extends Component<MergedProps> {
);
};

componentDidMount(): void {
this.props.setIsModal && this.props.setIsModal(true);
}

render(props: MergedProps) {
const {onClick, entryName, description, playerSize = ''} = props;
const {onClick, entryName, description, playerSize = '',handleKeyDown, addAccessibleChild} = props;
if (playerSize === PLAYER_SIZE.TINY) {
return null;
}
return (
<OverlayPortal>
<Overlay open onClose={onClick}>
<Overlay open onClose={onClick} addAccessibleChild={addAccessibleChild} handleKeyDown={handleKeyDown}>
<div className={[styles.infoRoot, styles[playerSize]].join(' ')} data-testid="infoRoot">
<div className={styles.entryName} data-testid="entryName">
{entryName}
Expand Down

0 comments on commit ef78c8e

Please sign in to comment.