@@ -20,7 +20,6 @@ import {DragAndDropHooks} from './useDragAndDrop';
2020import { DraggableCollectionState , DroppableCollectionState , Collection as ICollection , ListState , Node , SelectionBehavior , UNSTABLE_useFilteredListState , useListState } from 'react-stately' ;
2121import { filterDOMProps , inertValue , LoadMoreSentinelProps , useLoadMoreSentinel , useObjectRef } from '@react-aria/utils' ;
2222import { forwardRefType , GlobalDOMAttributes , HoverEvents , Key , LinkDOMProps , PressEvents , RefObject } from '@react-types/shared' ;
23- import { HeaderContext } from './Header' ;
2423import { ListStateContext } from './ListBox' ;
2524import React , { createContext , ForwardedRef , forwardRef , HTMLAttributes , JSX , ReactNode , useContext , useEffect , useMemo , useRef } from 'react' ;
2625import { SelectionIndicatorContext } from './SelectionIndicator' ;
@@ -579,11 +578,11 @@ export interface GridListSectionProps<T> extends SectionProps<T> {}
579578/**
580579 * A GridListSection represents a section within a GridList.
581580 */
582- export const GridListSection = /*#__PURE__*/ createBranchComponent ( SectionNode , < T extends object > ( props : GridListSectionProps < T > , ref : ForwardedRef < HTMLElement > , item : Node < T > ) => {
581+ export const GridListSection = /*#__PURE__*/ createBranchComponent ( SectionNode , < T extends object > ( props : GridListSectionProps < T > , ref : ForwardedRef < HTMLDivElement > , item : Node < T > ) => {
583582 let state = useContext ( ListStateContext ) ! ;
584583 let { CollectionBranch} = useContext ( CollectionRendererContext ) ;
585584 let headingRef = useRef ( null ) ;
586- ref = useObjectRef < HTMLElement > ( ref ) ;
585+ ref = useObjectRef < HTMLDivElement > ( ref ) ;
587586 let { rowHeaderProps, rowProps, rowGroupProps} = useGridListSection ( {
588587 'aria-label' : props [ 'aria-label' ] ?? undefined
589588 } , state , ref ) ;
@@ -598,33 +597,34 @@ export const GridListSection = /*#__PURE__*/ createBranchComponent(SectionNode,
598597 delete DOMProps . id ;
599598
600599 return (
601- < section
600+ < div
602601 { ...mergeProps ( DOMProps , renderProps , rowGroupProps ) }
603602 ref = { ref } >
604603 < Provider
605604 values = { [
606- [ HeaderContext , { ...rowProps , ref : headingRef } ] ,
607- [ GridListHeaderContext , { ...rowHeaderProps } ]
605+ [ GridListHeaderContext , { ...rowProps , ref : headingRef } ] ,
606+ [ GridListHeaderInnerContext , { ...rowHeaderProps } ]
608607 ] } >
609608 < CollectionBranch
610609 collection = { state . collection }
611610 parent = { item } />
612611 </ Provider >
613- </ section >
612+ </ div >
614613 ) ;
615614} ) ;
616615
617- const GridListHeaderContext = createContext < HTMLAttributes < HTMLElement > | null > ( null ) ;
616+ export const GridListHeaderContext = createContext < ContextValue < HTMLAttributes < HTMLDivElement > , HTMLDivElement > > ( { } ) ;
617+ const GridListHeaderInnerContext = createContext < HTMLAttributes < HTMLElement > | null > ( null ) ;
618618
619- export const GridListHeader = /*#__PURE__*/ createLeafComponent ( HeaderNode , function Header ( props : HTMLAttributes < HTMLElement > , ref : ForwardedRef < HTMLElement > ) {
620- [ props , ref ] = useContextProps ( props , ref , HeaderContext ) ;
621- let rowHeaderProps = useContext ( GridListHeaderContext ) ;
619+ export const GridListHeader = /*#__PURE__*/ createLeafComponent ( HeaderNode , function Header ( props : HTMLAttributes < HTMLElement > , ref : ForwardedRef < HTMLDivElement > ) {
620+ [ props , ref ] = useContextProps ( props , ref , GridListHeaderContext ) ;
621+ let rowHeaderProps = useContext ( GridListHeaderInnerContext ) ;
622622
623623 return (
624- < header className = "react-aria-GridListHeader" ref = { ref } { ...props } >
624+ < div className = "react-aria-GridListHeader" ref = { ref } { ...props } >
625625 < div { ...rowHeaderProps } style = { { display : 'contents' } } >
626626 { props . children }
627627 </ div >
628- </ header >
628+ </ div >
629629 ) ;
630630} ) ;
0 commit comments