@@ -87,7 +87,6 @@ const ObjectPage = forwardRef<ObjectPageDomRef, ObjectPagePropTypes>((props, ref
8787 const objectPageContentRef = useRef < HTMLDivElement > ( null ) ;
8888 const selectionScrollTimeout = useRef ( null ) ;
8989 const isToggledRef = useRef ( false ) ;
90- const isInitial = useRef ( true ) ;
9190 const scrollTimeout = useRef ( 0 ) ;
9291
9392 const [ selectedSubSectionId , setSelectedSubSectionId ] = useState < undefined | string > ( undefined ) ;
@@ -468,16 +467,6 @@ const ObjectPage = forwardRef<ObjectPageDomRef, ObjectPagePropTypes>((props, ref
468467 }
469468 } ;
470469
471- const snappedHeaderInObjPage = titleArea && titleArea . props . snappedContent && headerCollapsed === true && ! ! image ;
472-
473- useEffect ( ( ) => {
474- if ( ! isInitial . current ) {
475- scrollTimeout . current = performance . now ( ) + 200 ;
476- } else {
477- isInitial . current = false ;
478- }
479- } , [ snappedHeaderInObjPage ] ) ;
480-
481470 const renderHeaderContentSection = ( ) => {
482471 if ( headerArea ?. props ) {
483472 return cloneElement ( headerArea as ReactElement < ObjectPageHeaderPropTypesWithInternals > , {
@@ -598,33 +587,23 @@ const ObjectPage = forwardRef<ObjectPageDomRef, ObjectPagePropTypes>((props, ref
598587 data-not-clickable = { ! ! preserveHeaderStateOnClick }
599588 aria-roledescription = { accessibilityAttributes ?. objectPageTopHeader ?. ariaRoledescription ?? 'Object Page header' }
600589 className = { classNames . header }
601- style = { {
602- gridAutoColumns : `min-content ${
603- titleArea && image && headerCollapsed === true ? `calc(100% - 3rem - 1rem)` : '100%'
604- } `
605- } }
606590 >
607591 < span
608592 className = { classNames . clickArea }
609593 onClick = { onTitleClick }
610594 data-component-name = "ObjectPageTitleAreaClickElement"
611595 />
612- { titleArea && image && headerCollapsed === true && (
613- < CollapsedAvatar image = { image } imageShapeCircle = { imageShapeCircle } />
614- ) }
615596 { titleArea &&
616597 cloneElement ( titleArea as ReactElement < ObjectPageTitlePropsWithDataAttributes > , {
617598 className : clsx ( titleArea ?. props ?. className ) ,
618599 onToggleHeaderContentVisibility : onTitleClick ,
619600 'data-not-clickable' : ! ! preserveHeaderStateOnClick ,
620601 'data-header-content-visible' : headerArea && headerCollapsed !== true ,
621- 'data-is-snapped-rendered-outside' : snappedHeaderInObjPage
602+ _snappedAvatar :
603+ ! headerArea || ( titleArea && image && headerCollapsed === true ) ? (
604+ < CollapsedAvatar image = { image } imageShapeCircle = { imageShapeCircle } />
605+ ) : null
622606 } ) }
623- { snappedHeaderInObjPage && (
624- < div className = { classNames . snappedContent } data-component-name = "ATwithImageSnappedContentContainer" >
625- { titleArea . props . snappedContent }
626- </ div >
627- ) }
628607 </ header >
629608 { renderHeaderContentSection ( ) }
630609 { headerArea && titleArea && (
0 commit comments