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
You should see flashes of undefined-0-undefined before input updates to correct value
Problem
Our component is updating input value using both setState and event.target. After updating from microtick to setTimeout value that's set directly gets rendered before setState is flushed. We tried to avoid setting event.target value by cloning event into onInput but that caused our E2E cypress tests to fail due to a number of missing non-enumerable properties.
Our current solution is to set the value directly twice which is synchronous enough to avoid flashes of the second value.
Basically, I'm asking if what we're doing is safe? Are there any other solutions we're missing? It's not imperative that we update from 10.9.0 yet but might as well try to find workarounds.
Fixes#3775Fixes#3724
When we are in events we need setTimeout to deal with how events bubble, we want the events to complete before we start our rendering process. This however isn't needed when we are dealing with internal updates coming from effects/...
Co-authored-by: andrewiggins <andre@preact.dev>
Hi 👋
I am pretty sure this is not a Preact issue but I would like to present my problem and ask for advice.
Context
DateInput
component which masks user input to display it as MM/DD/YYYYonInput
prop with the whole input event where we format the value to be YYYY-MM-DD bc that's what our BE usesTo Reproduce
Here is a reduced example: https://codepen.io/teodragovic/pen/PoaYyma?editors=0011
(just skip down past utilities)
Steps to reproduce the behavior:
undefined-0-undefined
before input updates to correct valueProblem
Our component is updating
input
value using bothsetState
andevent.target
. After updating from microtick tosetTimeout
value that's set directly gets rendered beforesetState
is flushed. We tried to avoid settingevent.target
value by cloningevent
intoonInput
but that caused our E2E cypress tests to fail due to a number of missing non-enumerable properties.Our current solution is to set the value directly twice which is synchronous enough to avoid flashes of the second value.
Basically, I'm asking if what we're doing is safe? Are there any other solutions we're missing? It's not imperative that we update from 10.9.0 yet but might as well try to find workarounds.
Thanks!
EDIT: Changed version number from 1.9.0 to 10.9.0 - @marvinhagemeister
The text was updated successfully, but these errors were encountered: