Skip to content

Commit

Permalink
jaws navigable screenreader text
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamwasp committed Jul 16, 2024
1 parent 19ec4c7 commit f27b64a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 8 additions & 0 deletions packages/gamut/src/Tip/InfoTip/elements.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { css } from '@codecademy/gamut-styles';
import styled from '@emotion/styled';

import { Text } from '../../Typography';

export const ScreenreaderNavigableTaxt = styled(Text)(
css({ position: 'relative' })
);
10 changes: 7 additions & 3 deletions packages/gamut/src/Tip/InfoTip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useEffect, useRef, useState } from 'react';

import { Text } from '../../Typography';
import { FloatingTip } from '../shared/FloatingTip';
import { InlineTip } from '../shared/InlineTip';
import {
TipBaseAlignment,
TipBaseProps,
tipDefaultProps,
} from '../shared/types';
import { ScreenreaderNavigableTaxt } from './elements';
import { InfoTipButton } from './InfoTipButton';

export type InfoTipProps = TipBaseProps & {
Expand Down Expand Up @@ -96,9 +96,13 @@ export const InfoTip: React.FC<InfoTipProps> = ({
};

const text = (
<Text aria-hidden={isAriaHidden} aria-live="assertive" screenreader>
<ScreenreaderNavigableTaxt
aria-hidden={isAriaHidden}
aria-live="assertive"
screenreader
>
{!isTipHidden ? info : `\xa0`}
</Text>
</ScreenreaderNavigableTaxt>
);

const tip = (
Expand Down

0 comments on commit f27b64a

Please sign in to comment.