Skip to content

Commit

Permalink
add accessibility text
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrtj committed Oct 21, 2024
1 parent 4b54564 commit 0677ba2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/eui/src/components/filter_group/filter_button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
euiFilterButtonStyles,
euiFilterButtonChildStyles,
} from './filter_button.styles';
import { EuiScreenReaderOnly } from '../accessibility';

export type EuiFilterButtonProps = {
/**
Expand Down Expand Up @@ -152,6 +153,12 @@ export const EuiFilterButton: FunctionComponent<EuiFilterButtonProps> = ({
const dataText =
children && typeof children === 'string' ? children : innerText;

const accessibleText = (
<EuiScreenReaderOnly>
<span>{useEuiI18n('euiFilterButton.accessibleText', 'select')}</span>
</EuiScreenReaderOnly>
);

const textContent = (
<span
ref={ref}
Expand All @@ -162,6 +169,7 @@ export const EuiFilterButton: FunctionComponent<EuiFilterButtonProps> = ({
css={textCssStyles}
>
{children}
{accessibleText}
</span>
);

Expand Down

0 comments on commit 0677ba2

Please sign in to comment.