File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ Now, you'll have to import the A11yAnnouncer component. We usually place it next
25
25
< Canvas>
26
26
{... }
27
27
< / Canvas>
28
+ < A11yAnnouncer / >
28
29
```
29
30
30
31
This will both help us emulate focus inside the canvas and provide some text to screen readers when nescessary.
@@ -35,7 +36,6 @@ Then you wrap the 3D objects you want to make focusable like so
35
36
``` jsx
36
37
import { A11yAnnouncer , A11y } from " @react-three/a11y"
37
38
38
- < A11yDom >
39
39
< Canvas>
40
40
{... }
41
41
< A11y>
@@ -47,7 +47,7 @@ Then you wrap the 3D objects you want to make focusable like so
47
47
< / A11y>
48
48
{... }
49
49
< / Canvas>
50
- < / A11yDom >
50
+ < A11yAnnouncer / >
51
51
```
52
52
53
53
At this point both My3DComponent and AGroupOf3DComponent can receive focus.
@@ -67,8 +67,8 @@ import useA11y from '@react-three/a11y' then
67
67
68
68
const My3DComponent = (props) {
69
69
70
- // call useA11yContext to get the A11yContext from the provider
71
- const a11yContext = useA11yContext ();
70
+ // call useA11y to get the A11yContext from the provider
71
+ const a11yContext = useA11y ();
72
72
// now you have access to a11yContext.hover, a11yContext.focus and a11yContext.pressed
73
73
74
74
return (
You can’t perform that action at this time.
0 commit comments