react-modal-sheet
react-modal-sheet copied to clipboard
Is it possible to set snapshot as the content height value?
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.
It is similar to this issue. #46
In react-spring-bottom-sheet
, the minHeight argument is provided to the snapshot points
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?
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ลก
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.
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!
Sheet detent
is now implemented in v1.7.0. Please let me know if it doesn't solve your content height related issues ๐