Skip to content

Commit dc37154

Browse files
committed
fix: renderKeytips, add aria-hidden
1 parent 6238ed1 commit dc37154

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

packages/react-keytips/src/components/Keytips/renderKeytips.tsx

+19-17
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,25 @@ export const renderKeytips_unstable = (state: KeytipsState) => {
2121
const classes = useStyles();
2222

2323
return (
24-
<Portal
25-
mountNode={{
26-
className: classes.portal,
27-
...state.mountNode,
28-
}}
29-
>
30-
<span
31-
id={KTP_ROOT_ID}
32-
style={VISUALLY_HIDDEN_STYLES}
33-
data-start-shortcut={state.content}
24+
<div id="keytips-container" aria-hidden="true">
25+
<Portal
26+
mountNode={{
27+
className: classes.portal,
28+
...state.mountNode,
29+
}}
3430
>
35-
{state.content}
36-
</span>
37-
{state.keytips}
38-
{state.visibleKeytips.length > 0 && (
39-
<state.root>{state.visibleKeytips}</state.root>
40-
)}
41-
</Portal>
31+
<span
32+
id={KTP_ROOT_ID}
33+
style={VISUALLY_HIDDEN_STYLES}
34+
data-start-shortcut={state.content}
35+
>
36+
{state.content}
37+
</span>
38+
{state.keytips}
39+
{state.visibleKeytips.length > 0 && (
40+
<state.root>{state.visibleKeytips}</state.root>
41+
)}
42+
</Portal>
43+
</div>
4244
);
4345
};

0 commit comments

Comments
 (0)