Custom Turbo Confirm Modals with Hotwire in Rails Discussion
Any insider info on when your PR for this is going to be shipped/released?
https://github.com/hotwired/turbo/pull/525/files
Ya I'm waiting for turbo to be tagged and released as well, how do we reference a github ref for rails to correctly build the js with a branched lib? I'm still confused about how to get the correct versions of JS libs in my app with npm, yarn, and importmaps all playing some part in managing the libs.
Can anyone provide any tips on how to make it so the rails-turbo gem uses the edge version of the @hotwired/turbo NPM dependency? They haven't released a new version of turbo for about 9 months and along with this update that Chris made, there are numerous other fixes.
I was able to get it work by adding a dependency to the latest turbo build in my package.json using the hotwired/dev-builds branch
I added the following then ran yarn install -f
"@hotwired/turbo": "hotwired/dev-builds#@hotwired/turbo/latest",
This broke every turbo_stream_from
tag I had in the app. As in, the frontend wouldn't be listen to updates over the cable. Have you found a workaround for that?
pls can anyone help me here, I used turbo approach cos I need modal/bootsrap for the project but the FORM hardly show on web page and the item get deleted immediately without confirmation, anybody??
Hello there I've been trying to make custom turbo_confirm modal and i noticed a problem, the modal pops up for a second and thing gets deleted I don't even have time to confirm it or cancel.
I used this snippet to close the dialog when someone clicks the backdrop.
dialog.addEventListener('click', (event) => {
if (event.target.nodeName === 'DIALOG') {
dialog.close();
}
});
From here:
https://www.stefanjudis.com/blog/a-look-at-the-dialog-elements-super-powers/