Skip to content

Commit f7ae304

Browse files
fix: includes message from message box into buttons aria-label, to make message accessible for voiceover. (#191)
* Passing message as prop to include message in buttons arial-label when using voiceover. * Pass aria-label as buttonProp. * Remove exessive aria-label attribute. * Update src/components/message-box/index.tsx Co-authored-by: Morten Nordseth <[email protected]> --------- Co-authored-by: Morten Nordseth <[email protected]>
1 parent fbe8e89 commit f7ae304

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/message-box/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Typo } from '@atb/components/typography';
1010

1111
import style from './message-box.module.css';
1212
import { colorToOverrideMode } from '@atb/utils/color';
13+
import { screenReaderPause } from '@atb/components/typography/utils';
1314

1415
export type MessageMode = keyof Theme['static']['status'];
1516

@@ -69,6 +70,11 @@ export const MessageBox = ({
6970
title={t(dictionary.readMore)}
7071
className={style.messageBox__button}
7172
size="compact"
73+
buttonProps={{
74+
'aria-label': `${message}${screenReaderPause}${t(
75+
dictionary.readMore,
76+
)}`,
77+
}}
7278
/>
7379
)}
7480
</div>

0 commit comments

Comments
 (0)