Hotwire Discussion

Reloading on assets change is causing data loss in forms with validation errors

Hi everyone,

Reloading on assets change is important feature of Turbo. Unfortunately there is a problem when user opens form and assets change when user is filling the form, if all validation pass during form submission everything is fine, but if there are validation errors Turbo receives form with validation errors with info about new assets and triggers page reload which causes loss of all data and validation errors in the form.

Reloading on assets change

It is quite unpleasant. I am actually not sure what is desired behaviour here. On one side I understand that something could have been changed in the form itself and new behaviour has to be loaded on the other side potential loss of data in a form is not good behaviour. My solution is to turn off Turbo for almost all forms in our app for now.

Did you encounter similar problems? What was your solution for this problem or is it no issue for you?