Comments (9)
@boardfish @dhh moved data-turbo="false"
to the form tag and it works great now, thanks!
from turbo.
Upgraded to the new beta and the issue remains, unfortunately.
from turbo.
It's not the button that needs data-turbo="false", it's the form that button belongs to.
from turbo.
We just released 7.0.0-beta.2 which allows you to opt out of form submissions with data-turbo="false"
.
from turbo.
Testing this now for my use case. I'll close if it rectifies my issue.
from turbo.
@boardfish same here. Updated my button code to:
<button data-turbo="false" type="submit" name="subscribe" class="button is-medium is-black is-outlined is-fullwidth">Subscribe 🚀</button>
And it doesn't work, here's the console.error I'm getting:
from turbo.
That's correct for buttons, but the link in the OP doesn't have a surrounding form. The data-method
attribute controls the request method. I think this particular case is using fetch
regardless of whether Turbo is enabled or not.
from turbo.
Ah yeah, then that's a bug. Turbo shouldn't be dealing with links that have data-turbo=false. cc @sstephenson
from turbo.
@timonweb Your button should look like this:
<form data-turbo="false" method="post" action="/subscribe">
<input class="button is-medium is-black is-outlined is-fullwidth" name="subscribe" type="submit" value="Subscribe 🚀">
</form>
If you're on Rails, use a form helper:
<%= button_to 'Subscribe 🚀', '/subscribe', class: 'button is-medium is-black is-outlined is-fullwidth', name: 'subscribe', form: { 'data-turbo': false } %>
Hope that helps!
from turbo.
Related Issues (20)
- Navigating to the `turbo-root` doesn't use Turbo Drive
- No compiled version? HOT 1
- data-turbo-method=delete and CSRF token
- turbo:load doesn't fire if the user is redirected after submitting a form
- CSRF Token Exposure HOT 3
- [Feature request] Global flag to disable link hijacking within `<turbo-frame>`s by default HOT 2
- Element with data-turbo-cached=false or data-turbo-temporary placed outside turbo frame disappears after framed request HOT 1
- Replace call to requestAnimationFrame in render function to update page content even if tab has lost focus
- FrameElement.reload() is currently useless HOT 2
- No Limit on Cache Size
- Proposal: Rename `Vnd.Prefetch` header set when preloading links HOT 4
- Turbo frame contains busy and complete when navigating history HOT 2
- Regression from PR 240 around removing target children before append / prepend? HOT 4
- `broadcast_remove_to` conflicts with input field named "remove"
- Feature request: Allow specifying target element to insert form when using anchor with data-turbo-method
- Chrome crashes when a turbo frame response contains <form name="location"> HOT 6
- Proposal: Turbo Stream apply to Template Tags HOT 1
- turbo:beforeunload
- Unable to update input value with form.requestSubmit(), turbo:submit-end shows the correct value in the console for formElement but not if I access the element directly
- [dupe #577] FrameController.prepareRequest overrides Turbo-Frame header, ignoring explicit data-turbo-frame HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbo.