Closed bcomnes closed 7 years ago
Tested in choo 5, but swapping out for morphdom is getting the same behavior. Hrmm....
Have you set the "value" attribute to be what the latest value is?
No, in this case I didn't. I'll try that, but this would be a behavior change from choo4.
but this would be a behavior change from choo4
That's correct - the other behavior was kinda weird and treated input fields like one-off stateful things. That became annoying when you replaced one form with another, because the initial value would need to be cleared, which would need to be a manual action somehow in an onload
selector.
Now that choo v5 is moving from an async event model to a sync one, it actually makes sense to keep the state and the value of the input in sync - if only so re-renders of the DOM actually become a function of state, rather than having a few loose ends that are weirdly stateful. Hope that makes sense! :sparkles:
@bcomnes did this work?
Hey sorry for the delay. I'm almost sure this would work, I just haven't had a chance to test yet. I'll close soon.
Yes, works! Should we note this in the changelog of Choo?
@bcomnes yeah we def should! :sparkles:
When typing into an input search input box, the input is cleared every time, which is a behavioral difference to morphdom.