You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #1141, Idiomorph was changed to use ignoreActiveValue: true. That maybe makes sense... but it prevents a form from being reset/cleared.
For example, in the following form, after submitting, the page redirects to the same URL, but with an empty form. The behavior varies based on whether an input is active or not. In the video:
Submit 1 (:00-:04) hitting enter while inside the <input> results in that field NOT being cleared (wrong behavior).
Submit 2 (:05-:10) clicking the submit button makes it the activeElement and then all fields are cleared.
turbo-form-reset.mp4
I'm not sure how to handle this. In #1141, @seanpdoyle added ignoreActiveValue: true to support things like auto-submitting forms while typing into an input. What's not clear in that example is this: was ignoreActiveValue: true added to preserve the value of the input or something with its active state? To ask differently: did the submitted form HTML used for morphing in that example contain the updated value="another search term" attribute value on the <input type="search">? If not, perhaps it should have... and the example was flawed (i.e. if the new <input type="search"> does not have a value, then the value should be cleared)? If yes, was ignoreActiveValue: true done to preserve some sort of focus or active state problem?
Hi there!
In #1141, Idiomorph was changed to use
ignoreActiveValue: true. That maybe makes sense... but it prevents a form from being reset/cleared.For example, in the following form, after submitting, the page redirects to the same URL, but with an empty form. The behavior varies based on whether an input is active or not. In the video:
:00-:04) hitting enter while inside the<input>results in that field NOT being cleared (wrong behavior).:05-:10) clicking the submit button makes it theactiveElementand then all fields are cleared.turbo-form-reset.mp4
I'm not sure how to handle this. In #1141, @seanpdoyle added
ignoreActiveValue: trueto support things like auto-submitting forms while typing into an input. What's not clear in that example is this: wasignoreActiveValue: trueadded to preserve the value of the input or something with its active state? To ask differently: did the submitted form HTML used for morphing in that example contain the updatedvalue="another search term"attribute value on the<input type="search">? If not, perhaps it should have... and the example was flawed (i.e. if the new<input type="search">does not have a value, then the value should be cleared)? If yes, wasignoreActiveValue: truedone to preserve some sort of focus or active state problem?Thanks!