File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ describe('inverse mode triggers next near top', () => {
5252 expect ( options . rootMargin ) . toBe ( '20% 0px 0px 0px' ) ;
5353 } ) ;
5454
55- it ( 'renders sentinel as first child in inverse mode' , ( ) => {
55+ it ( 'renders sentinel as last child in inverse mode' , ( ) => {
5656 const { container } = render (
5757 < InfiniteScroll
5858 dataLength = { 5 }
@@ -69,8 +69,9 @@ describe('inverse mode triggers next near top', () => {
6969 const inner = container . querySelector (
7070 '.infinite-scroll-component'
7171 ) as HTMLElement ;
72- // sentinel must be the first DOM child so the IO top-margin fires correctly
73- expect ( inner . firstElementChild ) . toBe (
72+ // sentinel is last DOM child; with flex-direction: column-reverse this puts
73+ // it at the visual top, where the IO top-margin extension pre-triggers
74+ expect ( inner . lastElementChild ) . toBe (
7475 MockIntersectionObserver . instances [ 0 ] . observedElements [ 0 ]
7576 ) ;
7677 } ) ;
Original file line number Diff line number Diff line change @@ -330,7 +330,6 @@ export default function InfiniteScroll({
330330 ref = { infScrollRef }
331331 style = { containerStyle }
332332 >
333- { inverse && sentinel }
334333 { pullDownToRefresh && (
335334 < div style = { { position : 'relative' } } ref = { pullDownRef } >
336335 < div
@@ -350,7 +349,7 @@ export default function InfiniteScroll({
350349 { children }
351350 { ! showLoader && ! hasChildrenResolved && hasMore && loader }
352351 { showLoader && hasMore && loader }
353- { ! inverse && sentinel }
352+ { sentinel }
354353 { ! hasMore && endMessage }
355354 </ div >
356355 </ div >
You can’t perform that action at this time.
0 commit comments