Closed deb17 closed 3 years ago
@deb17 this is likely a misunderstanding on your part on how turbo.js works. Are you responding to the form POST request with a stream response? If you are, then you have to include all the changes that need to appear in the form as a stream element.
It was an application error. I was setting the id of the changed element dynamically and failed to do so when the the template was rendered without turbo.
When submitting a post request for a form, if the form has errors, they fail to show up in the browser. I have a simple
flask-wtf
form withDataRequired
validation only. When I submit it (from a modal), the 'field is required' messages don't appear in the browser. If I print therender_template
output in the server, the messages are present. I noticed that if I comment out the{{ turbo() }}
tag, the messages appear in the browser as expected. (I am using turbo streams for my application). Could this be a bug in turbo.js?