Skip to content

Commit 1e0664a

Browse files
committed
fix: composer edit should put the cursor at the end
1 parent 8c9c93a commit 1e0664a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: src/status_im2/contexts/chat/composer/effects.cljs

+6-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@
121121
(reset! saved-cursor-position (if (zero? text-value-count)
122122
(count edit-text)
123123
text-value-count))
124-
(.setNativeProps ^js @input-ref (clj->js {:text edit-text})))]
124+
(when @input-ref
125+
(let [selection-pos (count edit-text)]
126+
(.setNativeProps ^js @input-ref
127+
(clj->js {:text edit-text
128+
:selection {:start selection-pos
129+
:end selection-pos}})))))]
125130
(when (and edit @input-ref)
126131
;; NOTE: A small setTimeout is necessary to ensure the focus is enqueued and is executed
127132
;; ASAP. Check https://github.com/software-mansion/react-native-screens/issues/472

0 commit comments

Comments
 (0)