react-modal-sheet icon indicating copy to clipboard operation
react-modal-sheet copied to clipboard

Is it possible to set snapshot as the content height value?

Open jungpaeng opened this issue 2 years ago โ€ข 4 comments

If the content height is 300, I would like to set the snapshot to 300. Also, if the height of the content changes, I want to recognize it.

jungpaeng avatar Mar 16 '22 05:03 jungpaeng

It is similar to this issue. #46 In react-spring-bottom-sheet, the minHeight argument is provided to the snapshot points

jungpaeng avatar Mar 16 '22 05:03 jungpaeng

Hello folks, any updates on this? On my project I have 3 or 4 sheet's with different children(height). Any idea how to make Sheet height dynamic?

milosjovancevic avatar Jul 21 '22 08:07 milosjovancevic

Hello again, After some time spent on figuring out solution (I failed to do so) I came by a pull request opened in repository https://github.com/Temzasse/react-modal-sheet/pull/83 which solved the problem I had. Since my project deadline is soon I decided to fork the solution from this exceptional gentleman & developer @nickgraffis and publish it in npm. Here is the link in case someone needs it https://www.npmjs.com/package/@milosj/react-modal-sheet

After that you just add useContentHeight prop to your Sheet component and everything works like a charm. Sheet height is adjusted to the height of the children.

Once more big thanks to @nickgraffis!

Best regards, Miloลก

milosjovancevic avatar Jul 21 '22 15:07 milosjovancevic

Sorry for taking so long to respond to this ๐Ÿ˜…

I took a look at the PR and it seems like a good change (just need to resolve some prop naming nit picks). I wonder if there are other things that should be taken into account for this to work as people expect ๐Ÿค” I guess we can publish the fix from Nick and figure out other things later if this change already helps people.

Temzasse avatar Jul 24 '22 19:07 Temzasse

Sorry for taking so long to respond to this ๐Ÿ˜…

I took a look at the PR and it seems like a good change (just need to resolve some prop naming nit picks). I wonder if there are other things that should be taken into account for this to work as people expect ๐Ÿค” I guess we can publish the fix from Nick and figure out other things later if this change already helps people.

I would really appreciate this feature!

aliceathens avatar Oct 06 '22 13:10 aliceathens

Sheet detent is now implemented in v1.7.0. Please let me know if it doesn't solve your content height related issues ๐Ÿ™‚

Temzasse avatar Oct 11 '22 14:10 Temzasse