Closed jjf21 closed 2 years ago
Can you please share a link to your page so I can take a look?
Here it is: click on the "coloris page >" link on: https://cv-designerr.herokuapp.com/coloris_test
You'll have a coloris form with the error, reload manually, and Coloris will be correctly set.
It's a rails app, and pages are loaded with Turbo (https://github.com/hotwired/turbo-rails). Probably a problem with how Turbo render the page and how Coloris init the inputs.
Thanks for your help!
I tried to put the CDN script at the bottom of the body (was in the head), and Color picker is initialize, but the error still pop in console.
Turbo seems to operate by replacing the content of <body>
every time the page is re-rendered (when clicking on a link for instance), which destroys the hidden color picker <div>
at the bottom of the page. I don't see any simple solution for this. Maybe check if there is a way to tell Turbo to preserve some of the content of the page on re-render.
Solved this using the npm package "https://github.com/melloware/coloris-npm" I was unable to use it at first (https://github.com/melloware/coloris-npm/issues/59) but now it's working perfectly. Thanks for your help
Look like when turbo render a page, Coloris raise an error
I use CDN and init with
turbo:load
eventI've tried to add a condition init
If the page is loaded with turbo I have the error, if i manually reload the page, it works
Anyone know where it could come from ? Thanks