Skip to content

Commit 23ebdb2

Browse files
committed
aria-hidden on altText as SR already announce it
1 parent d4a7ba5 commit 23ebdb2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

example/src/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,17 @@ function Shapes({ transition, setLocation, setShowDialog, setDarktheme, darkthem
204204
<SimpleLink position={[-5, 0, 0]} direction="left" />
205205
</A11y>
206206
<A11y
207-
role="button"
208-
description="Dark mode button theme"
207+
role="content"
209208
showAltText={true}
209+
description="Dark mode button theme"
210210
pressedDescription="Dark mode button theme, activated"
211211
actionCall={() => setDarktheme(!darktheme)}
212212
activationMsg="Theme Dark enabled"
213213
desactivationMsg="Theme Dark disabled">
214214
<SimpleToggleButton position={[0, 0, 0]} />
215215
</A11y>
216216
<A11y
217-
role="button"
217+
role="content"
218218
showAltText={true}
219219
description="press this button to show a dialog"
220220
actionCall={() => setShowDialog(true)}

src/A11y.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export const A11y: React.FC<Props> = ({
222222
});
223223
}}
224224
>
225-
{description}
225+
<p>{description}</p>
226226
</dialog>
227227
);
228228
}
@@ -232,6 +232,7 @@ export const A11y: React.FC<Props> = ({
232232
if (showAltText && a11yState.hovered) {
233233
AltText = (
234234
<div
235+
aria-hidden={true}
235236
style={{
236237
width: 'auto',
237238
maxWidth: '300px',
@@ -246,6 +247,7 @@ export const A11y: React.FC<Props> = ({
246247
}}
247248
>
248249
<p
250+
aria-hidden={true}
249251
style={{
250252
margin: '0px',
251253
}}

0 commit comments

Comments
 (0)