parent
5bb954f8a7
commit
41282a9f5d
|
@ -89,7 +89,6 @@
|
||||||
(rn/use-effect
|
(rn/use-effect
|
||||||
(fn []
|
(fn []
|
||||||
(maximized-effect state animations dimensions chat-input)
|
(maximized-effect state animations dimensions chat-input)
|
||||||
(reenter-screen-effect state dimensions chat-input)
|
|
||||||
(layout-effect state)
|
(layout-effect state)
|
||||||
(kb-default-height-effect state)
|
(kb-default-height-effect state)
|
||||||
(background-effect state animations dimensions chat-input)
|
(background-effect state animations dimensions chat-input)
|
||||||
|
@ -98,7 +97,11 @@
|
||||||
(empty-effect state animations subscriptions)
|
(empty-effect state animations subscriptions)
|
||||||
(kb/add-kb-listeners props state animations dimensions)
|
(kb/add-kb-listeners props state animations dimensions)
|
||||||
#(component-will-unmount props))
|
#(component-will-unmount props))
|
||||||
[max-height]))
|
[max-height])
|
||||||
|
(rn/use-effect
|
||||||
|
(fn []
|
||||||
|
(reenter-screen-effect state dimensions subscriptions))
|
||||||
|
[max-height subscriptions]))
|
||||||
|
|
||||||
(defn use-edit
|
(defn use-edit
|
||||||
[{:keys [input-ref]}
|
[{:keys [input-ref]}
|
||||||
|
@ -106,12 +109,15 @@
|
||||||
{:keys [edit]}]
|
{:keys [edit]}]
|
||||||
(rn/use-effect
|
(rn/use-effect
|
||||||
(fn []
|
(fn []
|
||||||
(let [edit-text (get-in edit [:content :text])]
|
(let [edit-text (get-in edit [:content :text])
|
||||||
|
text-value-count (count @text-value)]
|
||||||
(when (and edit @input-ref)
|
(when (and edit @input-ref)
|
||||||
(.focus ^js @input-ref)
|
(.focus ^js @input-ref)
|
||||||
(.setNativeProps ^js @input-ref (clj->js {:text edit-text}))
|
(.setNativeProps ^js @input-ref (clj->js {:text edit-text}))
|
||||||
(reset! text-value edit-text)
|
(reset! text-value edit-text)
|
||||||
(reset! saved-cursor-position (count edit-text)))))
|
(reset! saved-cursor-position (if (zero? text-value-count)
|
||||||
|
(count edit-text)
|
||||||
|
text-value-count)))))
|
||||||
[(:message-id edit)]))
|
[(:message-id edit)]))
|
||||||
|
|
||||||
(defn use-reply
|
(defn use-reply
|
||||||
|
|
Loading…
Reference in New Issue