@@ -47,22 +47,24 @@ export interface GridProps {
4747 renderDateAnnouncement : ( date : Date , isOnCurrentDate : boolean ) => string ;
4848 isSameDate : ( date : Date , baseDate : Date ) => boolean ;
4949 onGridKeyDownHandler : ( event : React . KeyboardEvent < HTMLElement > ) => void ;
50+ referrerId ?: string ;
5051}
5152
5253interface GridCellProps extends TdHTMLAttributes < HTMLTableCellElement > {
5354 disabledReason ?: string ;
55+ referrerId ?: string ;
5456}
5557
5658const GridCell = forwardRef ( ( props : GridCellProps , focusedDateRef : React . Ref < HTMLTableCellElement > ) => {
57- const { disabledReason, ...rest } = props ;
59+ const { disabledReason, referrerId , ...rest } = props ;
5860 const isDisabledWithReason = ! ! disabledReason ;
5961 const { targetProps, descriptionEl } = useHiddenDescription ( disabledReason ) ;
60- const ref = useRef < HTMLTableCellElement > ( null ) ;
62+ const cellRef = useRef < HTMLTableCellElement > ( null ) ;
6163 const [ showTooltip , setShowTooltip ] = useState ( false ) ;
6264
6365 return (
6466 < td
65- ref = { useMergeRefs ( focusedDateRef , ref ) }
67+ ref = { useMergeRefs ( focusedDateRef , cellRef ) }
6668 { ...( isDisabledWithReason ? targetProps : { } ) }
6769 { ...rest }
6870 onFocus = { ( ) => ( isDisabledWithReason ? setShowTooltip ( true ) : undefined ) }
@@ -77,9 +79,10 @@ const GridCell = forwardRef((props: GridCellProps, focusedDateRef: React.Ref<HTM
7779 { showTooltip && (
7880 < Tooltip
7981 className = { styles [ 'disabled-reason-tooltip' ] }
80- getTrack = { ( ) => ref . current }
82+ getTrack = { ( ) => cellRef . current }
8183 content = { disabledReason ! }
8284 onEscape = { ( ) => setShowTooltip ( false ) }
85+ referrerId = { referrerId }
8386 />
8487 ) }
8588 </ >
@@ -105,6 +108,7 @@ export default function Grid({
105108 renderDateAnnouncement,
106109 isSameDate,
107110 onGridKeyDownHandler,
111+ referrerId,
108112} : GridProps ) {
109113 const focusedDateRef = useRef < HTMLTableCellElement > ( null ) ;
110114
@@ -166,6 +170,7 @@ export default function Grid({
166170 [ styles [ 'calendar-date-dense' ] ] : denseGrid ,
167171 } ) }
168172 disabledReason = { isDisabledWithReason ? disabledReason : undefined }
173+ referrerId = { referrerId }
169174 >
170175 < span className = { styles [ 'date-inner' ] } aria-hidden = "true" >
171176 { renderDate ( date ) }
0 commit comments