File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/gamut/src/Tip/InfoTip Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
- import { useEffect , useRef , useState } from 'react' ;
1
+ import { useEffect , useId , useRef , useState } from 'react' ;
2
2
3
3
import { FloatingTip } from '../shared/FloatingTip' ;
4
4
import { InlineTip } from '../shared/InlineTip' ;
@@ -88,6 +88,8 @@ export const InfoTip: React.FC<InfoTipProps> = ({
88
88
89
89
const Tip = loaded && isFloating ? FloatingTip : InlineTip ;
90
90
91
+ const textId = useId ( ) ;
92
+
91
93
const tipProps = {
92
94
alignment,
93
95
escapeKeyPressHandler,
@@ -101,6 +103,7 @@ export const InfoTip: React.FC<InfoTipProps> = ({
101
103
< ScreenreaderNavigableText
102
104
aria-hidden = { isAriaHidden }
103
105
aria-live = "assertive"
106
+ id = { textId }
104
107
screenreader
105
108
>
106
109
{ ! isTipHidden ? info : `\xa0` }
@@ -109,6 +112,8 @@ export const InfoTip: React.FC<InfoTipProps> = ({
109
112
110
113
const tip = (
111
114
< InfoTipButton
115
+ aria-controls = { textId }
116
+ aria-expanded = { ! isTipHidden }
112
117
active = { ! isTipHidden }
113
118
emphasis = { emphasis }
114
119
onClick = { ( ) => clickHandler ( ) }
You can’t perform that action at this time.
0 commit comments