This is to demonstrate a Preline bug
-
Copy the repository
-
Run the setup tasks
-
Run in Tasks
- Prepare database
- build js and css OR watch:css and watch:js
- Run rails server
-
Open preview 3000 externally
-
Click on the sidebar toggle button
-
The sidebar works normally
-
Click on any link, they are all pointing to
"/" -
Turbo will replace the DOM with the new page
-
Click on the sidebar toggle button
-
The sidebar does not work anymore
Many issues point to adding this, (see for example)[htmlstreamofficial/preline#616 (comment)]
I know autoInit on turbo:load is the solution for DOM replacement, the issue is in the plugin itself.
I think I found where it happens, but not the root cause:
- the
"hidden"class is not appended anymore to the sidebar class list. - The only place where it is added is here https://github.com/htmlstreamofficial/preline/blob/b44656ea345e7ebd1cdad8213234a7382b276aa6/src/plugins/overlay/index.ts#L576
I hope this helps. Thank you for this great project! ❤️ <3