Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer committed Aug 12, 2022
1 parent b5303c1 commit 834c4c6
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/status_im/ui/screens/chat/components/input.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -522,27 +522,27 @@
(reanimated/set-shared-value shared-height (reanimated/with-timing min-y))
(re-frame/dispatch [:dismiss-keyboard])))))))
input-content-change (fn [evt]
(when (not= (:state @context) :max)
(let [new-y (+ min-y (- (max (oget evt "nativeEvent" "contentSize" "height") 22) 22))]
(println "cont change h" (oget evt "nativeEvent" "contentSize" "height") "new-y" new-y "max-y" max-y)
(if (< new-y max-y)
(do
(swap! context assoc :state :custom-chat-available)
(swap! context assoc :y new-y)
(when keyboard-shown
(reanimated/set-shared-value
translate-y
(reanimated/with-timing (- new-y)))
(reanimated/set-shared-value
shared-height
(reanimated/with-timing (min new-y max-height)))))
(do
(swap! context assoc :state :max)
(swap! context assoc :y max-y)
(when keyboard-shown
(reanimated/set-shared-value
translate-y
(reanimated/with-timing (- max-y)))))))))]
#_(when (not= (:state @context) :max)
(let [new-y (+ min-y (- (max (oget evt "nativeEvent" "contentSize" "height") 22) 22))]
(println "cont change h" (oget evt "nativeEvent" "contentSize" "height") "new-y" new-y "max-y" max-y)
(if (< new-y max-y)
(do
(swap! context assoc :state :custom-chat-available)
(swap! context assoc :y new-y)
(when keyboard-shown
(reanimated/set-shared-value
translate-y
(reanimated/with-timing (- new-y)))
(reanimated/set-shared-value
shared-height
(reanimated/with-timing (min new-y max-height)))))
(do
(swap! context assoc :state :max)
(swap! context assoc :y max-y)
(when keyboard-shown
(reanimated/set-shared-value
translate-y
(reanimated/with-timing (- max-y)))))))))]
(quo.react/effect! #(do
(println "effect" @keyboard-was-shown keyboard-shown (:state @context) (:y @context) y)
(when (and @keyboard-was-shown (not keyboard-shown))
Expand Down Expand Up @@ -598,6 +598,6 @@
;;SEND button
[rn/view {:ref send-ref :style (when-not show-send {:width 0 :right -100})}
[quo2/button {:icon true :size 32 :accessibility-label :send-message-button
:on-press #(do (clear-input chat-id refs)
:on-press #(do #_(clear-input chat-id refs)
(re-frame/dispatch [:chat.ui/send-current-message]))}
:main-icons2/arrow-up]]]]))])))])

0 comments on commit 834c4c6

Please sign in to comment.