-
Notifications
You must be signed in to change notification settings - Fork 396
Open
Description
Summary
On a turbo:load event, I use autoInit() but then overlay does not close anymore
Steps to Reproduce
This is how I found the bug, but I think it can be reproduced with simpe JS.
- Using Turbo with Ruby on Rails but I think this is irrelevant. We just need to replace the DOM
- Turbo replaces the HTML body of the page with the response body. Another DOM is then in place.
- There is an event listener on
turbo:loadthat re-initiate the components usingwindow.HSStaticMethods.autoInit(). Or we can just usewindow.HSOverlay.autoInit(), it will be the same result - When clicking on the toggle button, the sidebar does not get
"hidden"class as shown in the video
bug.mov
Please read the README.md for instructions and investigation
Thank you! ❤️
Demo Link
https://codesandbox.io/p/github/makikata/demo-preline/main
Expected Behavior
When I click on the toggle button it should hide the sidebar, the "hidden" class should be added to the sidebar
Actual Behavior
When I click on the toggle button does not hide the sidebar, the "hidden" class is not added to the sidebar
Screenshots
bug.mov
Metadata
Metadata
Assignees
Labels
No labels