Closed roman01la closed 2 years ago
If the input has focus, .-activeElement
check in input-node-set-value
is always true and input-component-set-value
and input-node-set-value
keep calling each other waiting on-change handler to update .-cljsDOMValue
, which doesn't happen here as the update is triggered from code.
I wrote a PR to avoid this by forcing input-node-set-value
to update cljsDOMValue
when it is called after render, but I'm not sure if this is a correct fix.
Other workaround could be to listen for focus
events and try to detect if the event is real or send from user code, but that would probably be quite unreliable.
Input fields wrapper in
reagent.impl.input
ns gets into an infinite loop when an input field goes in focus immediately after it was set a value. Note that the loop is async, thus it doesn't block UI thread. The issue is reproducible for any type of component: class-based with r/atom state, functional with r/atom state, functional with hooks state.Repro