File tree 1 file changed +10
-4
lines changed
src/status_im2/contexts/chat/composer
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 89
89
(rn/use-effect
90
90
(fn []
91
91
(maximized-effect state animations dimensions chat-input)
92
- (reenter-screen-effect state dimensions chat-input)
93
92
(layout-effect state)
94
93
(kb-default-height-effect state)
95
94
(background-effect state animations dimensions chat-input)
98
97
(empty-effect state animations subscriptions)
99
98
(kb/add-kb-listeners props state animations dimensions)
100
99
#(component-will-unmount props))
101
- [max-height]))
100
+ [max-height])
101
+ (rn/use-effect
102
+ (fn []
103
+ (reenter-screen-effect state dimensions subscriptions))
104
+ [max-height subscriptions]))
102
105
103
106
(defn use-edit
104
107
[{:keys [input-ref]}
105
108
{:keys [text-value saved-cursor-position]}
106
109
{:keys [edit]}]
107
110
(rn/use-effect
108
111
(fn []
109
- (let [edit-text (get-in edit [:content :text ])]
112
+ (let [edit-text (get-in edit [:content :text ])
113
+ text-value-count (count @text-value)]
110
114
(when (and edit @input-ref)
111
115
(.focus ^js @input-ref)
112
116
(.setNativeProps ^js @input-ref (clj->js {:text edit-text}))
113
117
(reset! text-value edit-text)
114
- (reset! saved-cursor-position (count edit-text)))))
118
+ (reset! saved-cursor-position (if (zero? text-value-count)
119
+ (count edit-text)
120
+ text-value-count)))))
115
121
[(:message-id edit)]))
116
122
117
123
(defn use-reply
You can’t perform that action at this time.
0 commit comments