How to properly integrate Preline UI and their js into rails 7 esbuild turbo app?
I know that the issue is related to turbo:load
, however I do not know how to address it.
So far I configured tailwind.config.js
to include require('preline/plugin')
I also added import "preline"
to app/javascript/application.js
And with standard turbo drive it works
However with turbo-frames it does not
Anyone has any experience with it?
Here is their basic doc about installation
kwhandy
(Handy Wardhana)
January 1, 2024, 6:28am
2
which preline version you use? currently, preline 2 or latest are broken
so if you want to use it, you have to specify the pkg version below v2
ok i found a solution here
opened 08:15AM - 22 Nov 23 UTC
closed 11:13PM - 29 Nov 23 UTC
I use Laravel 10 with inertia and vue3.
Every javascript trigger only works aft… er a page reload.
When navigating to another page and go back in my SPA none of the javascript is working.
With version 1.9.0 everything is fine (except the new added plugins :)).
Is version 2.0 compatible with inertia?
but regarding versions of preline, do you mean that in version 1.9 everything works properly with turbo out of the box?
And another issue is, could anyone explain it to me if for instance initializing those preline components at every turbo:load
could in any way impact the response time of our app?
webzorg
(Lasha Abulashvili)
January 28, 2025, 9:05pm
4
I found this method that you could throw in stimulus connect() function
HSSelect.autoInit()
Also make sure to call HSSelect.close()
either before init or in disconnect in order to avoid funny behavior on browser back/forward navigation