woofers / react-sheet-slide

🏞️ 🎢 🛝 A responsive React draggable sheet and dialog component
https://jaxs.onl/react-sheet-slide/
35 stars 5 forks source link

Callbacks for height change #16

Open rsimon opened 3 weeks ago

rsimon commented 3 weeks ago

Hi again,

shameless feature request: it would be fantastic to have a way to react to changes in the sheet position. Something like

<Sheet
  onHeightChange={({maxHeight, currentHeight}) => ...} />

I could possibly take a look myself and contribute, if you can point me to the best starting point?

woofers commented 2 weeks ago

@rsimon I think this is likely a missing component of this library that would be nice to have. I don't exactly remember but I think the logic that changes the detent is called here: https://github.com/woofers/react-sheet-slide/blob/main/packages/react-sheet-slide/src/sheet.tsx#L346.

If I have some time I may take a pass at solidifying what the API should look like