- Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
When I render this component:
(defn simple-text-field [text] (let [text-state (r/atom text)] (fn [] [rui/text-field {:id "example" :value @text-state :on-change (fn [e] (reset! text-state (.. e -target -value)))}])))
It seems to work well until I place the caret in the middle of the text and type again. Invariably, the caret jumps to the end after the insertion. The root cause seems to be that reagent re-renders components asynchronously. See http://stackoverflow.com/questions/28922275/in-reactjs-why-does-setstate-behave-differently-when-called-synchronously/28922465#28922465
Metadata
Metadata
Assignees
Labels
No labels