georgealways / lil-gui

Makes a floating panel for controllers on the web. Works as a drop-in replacement for dat.gui in most projects.
https://lil-gui.georgealways.com/
MIT License
1.15k stars 47 forks source link

Folder Toggle Functionality Not Working Properly #113

Closed JoeyQiao6 closed 1 year ago

JoeyQiao6 commented 1 year ago

I'm encountering an issue with the folder and control toggle functionality in lil-gui. It seems like there are two layers of panels. The outermost panel appears to work as expected, but the inner panel does not. When I try to click to toggle the folder, it shows the collapsing animation but doesn't actually collapse.

Would appreciate any guidance or fixes for this issue. Thank you!

https://github.com/georgealways/lil-gui/assets/96880446/634ff383-3e29-439f-8b98-ebb10f75175f

georgealways commented 1 year ago

Hi! Seems like you may be creating the same GUI twice? By default they're position: fixed, so they'll go on top of each other if more than one are created.

JoeyQiao6 commented 1 year ago

Thank you very much for your answers. I found the reason; it's because React's StrictMode intentionally triggers double rendering in development mode to detect side effects. Thank you very much.