I'm not currently doing this as I was not aware of this problem. But what I was thinking is very simple. What I'm doing now is always redirecting to a new url (hash change) after the http request is successful. Then I would change the redirect function like:
redirect location = Cmd.batch [formReset (), Navigation.newUrl <| "#/" ++ location] The formReset function is a trivial port with the javascript: document.forms[0].reset() On Wednesday, 21 December 2016 15:09:05 UTC-3, Wouter In t Velt wrote: > > Thanks all for sharing your approach to this! > > Op woensdag 21 december 2016 17:33:28 UTC+1 schreef Bernardo: >> >> For me the solution would be to perform a form.reset() before rendering >> the new view. >> > > Interesting: Could you elaborate on how you do that? > Re-render the form with a one-time reset on the input field values, so > they are emptied? > And then (after an AnimFrame and/or server-response) render new view? > > Op woensdag 21 december 2016 12:35:47 UTC+1 schreef Karol Samborski: >> >> I always used "lazy" for not updating value in rendered input after every >> key press. It is equivalent of react's "shouldComponentUpdate". >> > > Do you still set the input value + onInput handler in the lazy variant? > And does that also somehow prevent the "leak" of input value to a next > render? > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
