Closed erict11 closed 3 months ago
Hi, this is intentional. If you disable Turbo on that link, don't expect Turbo to intervene on it when you press it (neither to show the confirmation dialog). Turbo will simply ignore anything where you explicitly tell it that Turbo is disabled there.
Appreciate the clarification @brunoprietog but i must say this seems like a questionable decision if there is no fallback to the old confirmation syntax. The need for a regular HTML format request should not render en element incapable of facilitating a confirmation. I don't suppose there is a way to disable a turbo_stream
format request without disabling all of turbo so that a confirmation may still be supported?
It's not a direct replacement as such for data-confirm. In fact, they can coexist together. However, don't worry if all requests come in Turbo stream format. If you don't use Turbo streams at all, it will still behave as if you were using the HTML format.
I'm seeing an issue that prevents the turbo confirmation from firing when turbo is disabled but not sure if this is by design. Seems logical that one may want to disable the default
turbo_streams
request to the backend but keep the confirmation on the element.Example:
With
turbo: false
set, no confirmation is triggered but commenting that out or changing toturbo: true
starts firing the confirmation again. Is this a known issue or by design?For now I have a workaround in place using stimulus as such:
app/javascript/controllers/disabled_turbo_confirm_controller.js
Details
ruby:
3.3.2
rails:7.1.3.4
turbo-rails:1.5.0