@@ -1741,7 +1741,7 @@ describe('FragmentRefs', () => {
17411741 } ) ;
17421742
17431743 describe ( 'scrollIntoView' , ( ) => {
1744- // @gate enableFragmentRefs
1744+ // @gate enableFragmentRefs && enableFragmentRefsScrollIntoView
17451745 it ( 'does not yet support options' , async ( ) => {
17461746 const fragmentRef = React . createRef ( ) ;
17471747 const root = ReactDOMClient . createRoot ( container ) ;
@@ -1750,15 +1750,15 @@ describe('FragmentRefs', () => {
17501750 } ) ;
17511751
17521752 expect ( ( ) => {
1753- fragmentRef . current . scrollIntoView ( { block : 'start' } ) ;
1753+ fragmentRef . current . experimental_scrollIntoView ( { block : 'start' } ) ;
17541754 } ) . toThrowError (
1755- 'FragmentInstance.scrollIntoView () does not support ' +
1755+ 'FragmentInstance.experimental_scrollIntoView () does not support ' +
17561756 'scrollIntoViewOptions. Use the alignToTop boolean instead.' ,
17571757 ) ;
17581758 } ) ;
17591759
17601760 describe ( 'with children' , ( ) => {
1761- // @gate enableFragmentRefs
1761+ // @gate enableFragmentRefs && enableFragmentRefsScrollIntoView
17621762 it ( 'calls scrollIntoView on the first child by default, or if alignToTop=true' , async ( ) => {
17631763 const fragmentRef = React . createRef ( ) ;
17641764 const childARef = React . createRef ( ) ;
@@ -1780,19 +1780,19 @@ describe('FragmentRefs', () => {
17801780 childBRef . current . scrollIntoView = jest . fn ( ) ;
17811781
17821782 // Default call
1783- fragmentRef . current . scrollIntoView ( ) ;
1783+ fragmentRef . current . experimental_scrollIntoView ( ) ;
17841784 expect ( childARef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
17851785 expect ( childBRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 0 ) ;
17861786
17871787 childARef . current . scrollIntoView . mockClear ( ) ;
17881788
17891789 // alignToTop=true
1790- fragmentRef . current . scrollIntoView ( true ) ;
1790+ fragmentRef . current . experimental_scrollIntoView ( true ) ;
17911791 expect ( childARef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
17921792 expect ( childBRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 0 ) ;
17931793 } ) ;
17941794
1795- // @gate enableFragmentRefs
1795+ // @gate enableFragmentRefs && enableFragmentRefsScrollIntoView
17961796 it ( 'calls scrollIntoView on the last child if alignToTop is false' , async ( ) => {
17971797 const fragmentRef = React . createRef ( ) ;
17981798 const childARef = React . createRef ( ) ;
@@ -1810,12 +1810,12 @@ describe('FragmentRefs', () => {
18101810 childARef . current . scrollIntoView = jest . fn ( ) ;
18111811 childBRef . current . scrollIntoView = jest . fn ( ) ;
18121812
1813- fragmentRef . current . scrollIntoView ( false ) ;
1813+ fragmentRef . current . experimental_scrollIntoView ( false ) ;
18141814 expect ( childARef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 0 ) ;
18151815 expect ( childBRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
18161816 } ) ;
18171817
1818- // @gate enableFragmentRefs
1818+ // @gate enableFragmentRefs && enableFragmentRefsScrollIntoView
18191819 it ( 'handles portaled elements -- same scroll container' , async ( ) => {
18201820 const fragmentRef = React . createRef ( ) ;
18211821 const childARef = React . createRef ( ) ;
@@ -1847,12 +1847,12 @@ describe('FragmentRefs', () => {
18471847 childBRef . current . scrollIntoView = jest . fn ( ) ;
18481848
18491849 // Default call
1850- fragmentRef . current . scrollIntoView ( ) ;
1850+ fragmentRef . current . experimental_scrollIntoView ( ) ;
18511851 expect ( childARef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
18521852 expect ( childBRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 0 ) ;
18531853 } ) ;
18541854
1855- // @gate enableFragmentRefs
1855+ // @gate enableFragmentRefs && enableFragmentRefsScrollIntoView
18561856 it ( 'handles portaled elements -- different scroll container' , async ( ) => {
18571857 const fragmentRef = React . createRef ( ) ;
18581858 const headerChildRef = React . createRef ( ) ;
@@ -1983,7 +1983,7 @@ describe('FragmentRefs', () => {
19831983 } ) ;
19841984
19851985 // Default call
1986- fragmentRef . current . scrollIntoView ( ) ;
1986+ fragmentRef . current . experimental_scrollIntoView ( ) ;
19871987 expect ( childCRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
19881988 // In the same group as A, we use the first child
19891989 expect ( childBRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -1999,7 +1999,7 @@ describe('FragmentRefs', () => {
19991999 logs = [ ] ;
20002000
20012001 // // alignToTop=false
2002- fragmentRef . current . scrollIntoView ( false ) ;
2002+ fragmentRef . current . experimental_scrollIntoView ( false ) ;
20032003 expect ( headerChildRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
20042004 // In the same group as B, only attempt B which is the last child
20052005 expect ( childARef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -2013,7 +2013,7 @@ describe('FragmentRefs', () => {
20132013 } ) ;
20142014
20152015 describe ( 'without children' , ( ) => {
2016- // @gate enableFragmentRefs
2016+ // @gate enableFragmentRefs && enableFragmentRefsScrollIntoView
20172017 it ( 'calls scrollIntoView on the next sibling by default, or if alignToTop=true' , async ( ) => {
20182018 const fragmentRef = React . createRef ( ) ;
20192019 const siblingARef = React . createRef ( ) ;
@@ -2035,19 +2035,19 @@ describe('FragmentRefs', () => {
20352035 siblingBRef . current . scrollIntoView = jest . fn ( ) ;
20362036
20372037 // Default call
2038- fragmentRef . current . scrollIntoView ( ) ;
2038+ fragmentRef . current . experimental_scrollIntoView ( ) ;
20392039 expect ( siblingARef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 0 ) ;
20402040 expect ( siblingBRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
20412041
20422042 siblingBRef . current . scrollIntoView . mockClear ( ) ;
20432043
20442044 // alignToTop=true
2045- fragmentRef . current . scrollIntoView ( true ) ;
2045+ fragmentRef . current . experimental_scrollIntoView ( true ) ;
20462046 expect ( siblingARef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 0 ) ;
20472047 expect ( siblingBRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
20482048 } ) ;
20492049
2050- // @gate enableFragmentRefs
2050+ // @gate enableFragmentRefs && enableFragmentRefsScrollIntoView
20512051 it ( 'calls scrollIntoView on the prev sibling if alignToTop is false' , async ( ) => {
20522052 const fragmentRef = React . createRef ( ) ;
20532053 const siblingARef = React . createRef ( ) ;
@@ -2079,12 +2079,12 @@ describe('FragmentRefs', () => {
20792079 siblingBRef . current . scrollIntoView = jest . fn ( ) ;
20802080
20812081 // alignToTop=false
2082- fragmentRef . current . scrollIntoView ( false ) ;
2082+ fragmentRef . current . experimental_scrollIntoView ( false ) ;
20832083 expect ( siblingARef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
20842084 expect ( siblingBRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 0 ) ;
20852085 } ) ;
20862086
2087- // @gate enableFragmentRefs
2087+ // @gate enableFragmentRefs && enableFragmentRefsScrollIntoView
20882088 it ( 'calls scrollIntoView on the parent if there are no siblings' , async ( ) => {
20892089 const fragmentRef = React . createRef ( ) ;
20902090 const parentRef = React . createRef ( ) ;
@@ -2100,7 +2100,7 @@ describe('FragmentRefs', () => {
21002100 } ) ;
21012101
21022102 parentRef . current . scrollIntoView = jest . fn ( ) ;
2103- fragmentRef . current . scrollIntoView ( ) ;
2103+ fragmentRef . current . experimental_scrollIntoView ( ) ;
21042104 expect ( parentRef . current . scrollIntoView ) . toHaveBeenCalledTimes ( 1 ) ;
21052105 } ) ;
21062106 } ) ;
0 commit comments