bvaughn / react-resizable-panels

https://react-resizable-panels.vercel.app/
MIT License
3.6k stars 125 forks source link

Replacing document with group panel element #258

Closed Psvensso closed 6 months ago

Psvensso commented 6 months ago

As described in #204 the hard dependency on global document can be an problem in some context.

TL;DR; on changes: Sets up a ref to the PanelGroup and adds it to the group context Prevented some prop drilling of the element. Initializes helper hooks with the new group element ref Set up a dependency parameter on the group element in the helper functions Decided to make the group element required instead of defaulting to document for testing purposes and for predicability. But could be nullable and default to document. Tweaked a few tests by adding the root element to the helper function

Fixes 204

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-resizable-panels ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2024 6:25pm
bvaughn commented 6 months ago

I'm going to tweak a few things but I think this approach seems reasonable. Thanks!

bvaughn commented 6 months ago

Version 1.0.8 should now work with shadow dom


❤️ → ☕ givebrian.coffee