Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbo Confirm is Ignored without Turbo Method #1296

Open
DaAwesomeP opened this issue Aug 18, 2024 · 3 comments · May be fixed by #874
Open

Turbo Confirm is Ignored without Turbo Method #1296

DaAwesomeP opened this issue Aug 18, 2024 · 3 comments · May be fixed by #874

Comments

@DaAwesomeP
Copy link

Hello,

I have a vanilla rails new app with Rails 7.2.0. I have not touched any of the default Turbo configuration. I have confirmed with the web console that Turbo is enabled and the JS is included in the page.

If I create a link like:

<a class="nav-link" data-turbo-confirm="Are you sure?" href="/index2">Index 2</a>

then I do not see a conformation.

But if I do this:

<a class="nav-link" data-turbo-confirm="Are you sure?" data-turbo-method="get" href="/index2">Index 2</a>

then I see the confirmation prompt.

These links are in normal templates. I have not explicitly disabled Turbo anywhere.

From the docs (https://turbo.hotwired.dev/handbook/drive#requiring-confirmation-for-a-visit) it seems that shouldn't be necessary?

@marcoroth
Copy link
Member

This should by solved by #874

@DaAwesomeP
Copy link
Author

Another possibly separate issue: If a link is to another domain/external, then adding data-turbo-method will cause Turbo to handle it, but it will ignore data-turbo-confirm.

@tpaulshippy
Copy link

Or #1266 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants