react-spring-bottom-sheet icon indicating copy to clipboard operation
react-spring-bottom-sheet copied to clipboard

feat: add containerRef prop for portal

Open TylerAHolden opened this issue 4 years ago • 9 comments

This will allow you to pass a containerRef prop to the portal so that the bottom sheet is rendered where you want it rather than forcing it to be the last element in

TylerAHolden avatar Oct 29 '21 18:10 TylerAHolden

This would probably also resolve particular use cases like: https://github.com/stipsan/react-spring-bottom-sheet/issues/77 if I read his question correctly so he can choose where the bottom sheet is rendered rather than mess with z-indexs

TylerAHolden avatar Oct 29 '21 18:10 TylerAHolden

would this allow to pointing the scroller element ref? I'm asking because, I would like to have access to the div element into the bottom-sheet that is managing the scroll, to be able to reuse the behavior for some particular cases i.e. I'm using a virtualized list in the content of the bottom-sheet, suppose you have one snap point (within a virtualized list with fix height that is overflowing the first snap until the maxHeight) and would be nice to be able dragging it up to the maxHeight snap and then be able to start scrolling the content like if the sheet overflow exists (there isn't actually because the list height fit into the maxHeight of the sheet)

My question is: how should I use the bottomSheet with a virtualized list to opening quickly, then be draggable up to next snap and then have a smooth scrolling once the sheet reach the maxHeight ?? I have not access to the spring velocity nor the scrollElement ref. Sorry for the long question

Guiw5 avatar Nov 03 '21 00:11 Guiw5

@Guiw5 No i think you're asking for something different than what this does. This PR just simply allows you to tell the reach portal where in the DOM to put the bottom sheet.

TylerAHolden avatar Nov 03 '21 00:11 TylerAHolden

would this allow to pointing the scroller element ref? I'm asking because, I would like to have access to the div element into the bottom-sheet that is managing the scroll, to be able to reuse the behavior for some particular cases i.e. I'm using a virtualized list in the content of the bottom-sheet, suppose you have one snap point (within a virtualized list with fix height that is overflowing the first snap until the maxHeight) and would be nice to be able dragging it up to the maxHeight snap and then be able to start scrolling the content like if the sheet overflow exists (there isn't actually because the list height fit into the maxHeight of the sheet)

My question is: how should I use the bottomSheet with a virtualized list to opening quickly, then be draggable up to next snap and then have a smooth scrolling once the sheet reach the maxHeight ?? I have not access to the spring velocity nor the scrollElement ref. Sorry for the long question

@stipsan just wanted to let you know this intended use case has been asked in more than one of this sheet libraries, it would be a nice to have feature, it doesn't seems to be much effort butI know you are currently rebuilding this, thanks for everything!

Guiw5 avatar Dec 16 '21 15:12 Guiw5

Hello @TylerAHolden and @stipsan I really need this feature added. Can I help with anything to have this merged?

DomingosMartins avatar Oct 10 '22 11:10 DomingosMartins

I need this props too...

nazaninroozbahani avatar Nov 12 '22 16:11 nazaninroozbahani

We need this too.... Is there anything new here yet?

motto76 avatar Sep 11 '23 10:09 motto76

I need this feature too

nasterblue avatar Jan 04 '24 03:01 nasterblue