From f031d2b32d6a0390dba4e4ebdfde34ffaacdfaba Mon Sep 17 00:00:00 2001 From: andrey Date: Fri, 13 Aug 2021 10:35:15 +0200 Subject: [PATCH] [#12443] long press is long and it makes the message disappear entirely Signed-off-by: andrey --- .../ui/screens/chat/message/message.cljs | 20 +++++++++++-------- .../ui/screens/chat/message/reactions.cljs | 1 - .../ui/screens/chat/message/styles.cljs | 1 + 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/status_im/ui/screens/chat/message/message.cljs b/src/status_im/ui/screens/chat/message/message.cljs index ad2484b213..aa5494ed11 100644 --- a/src/status_im/ui/screens/chat/message/message.cljs +++ b/src/status_im/ui/screens/chat/message/message.cljs @@ -416,14 +416,15 @@ message-height-px))] [react/touchable-highlight (when-not modal - {:on-press (fn [_] - (react/dismiss-keyboard!)) - :on-long-press (fn [] - (if @collapsed? - (do (reset! collapsed? false) - (js/setTimeout #(on-long-press-fn on-long-press message content) 200)) - (on-long-press-fn on-long-press message content))) - :disabled in-popover?}) + {:on-press (fn [_] + (react/dismiss-keyboard!)) + :delay-long-press 100 + :on-long-press (fn [] + (if @collapsed? + (do (reset! collapsed? false) + (js/setTimeout #(on-long-press-fn on-long-press message content) 200)) + (on-long-press-fn on-long-press message content))) + :disabled in-popover?}) [react/view {:style (style/message-view message)} [react/view {:style (style/message-view-content) :max-height max-height} @@ -488,6 +489,7 @@ {:disabled in-popover? :on-press (fn [] (react/dismiss-keyboard!)) + :delay-long-press 100 :on-long-press (fn [] (on-long-press (concat @@ -521,6 +523,7 @@ (when pack (re-frame/dispatch [:stickers/open-sticker-pack pack])) (react/dismiss-keyboard!)) + :delay-long-press 100 :on-long-press (fn [] (on-long-press (when-not outgoing @@ -537,6 +540,7 @@ [message-content-wrapper message [message-content-image message {:modal modal :disabled in-popover? + :delay-long-press 100 :on-long-press (fn [] (on-long-press [{:on-press #(re-frame/dispatch [:chat.ui/reply-to-message message]) diff --git a/src/status_im/ui/screens/chat/message/reactions.cljs b/src/status_im/ui/screens/chat/message/reactions.cljs index f2d12bc921..cf93fd41a8 100644 --- a/src/status_im/ui/screens/chat/message/reactions.cljs +++ b/src/status_im/ui/screens/chat/message/reactions.cljs @@ -63,7 +63,6 @@ (reset! visible true))] [:<> [rn/view {:ref ref - :style {:opacity (if @visible 0 1)} :collapsable false} [render message {:modal false :on-long-press (fn [act] diff --git a/src/status_im/ui/screens/chat/message/styles.cljs b/src/status_im/ui/screens/chat/message/styles.cljs index a71071b55e..d5739e8702 100644 --- a/src/status_im/ui/screens/chat/message/styles.cljs +++ b/src/status_im/ui/screens/chat/message/styles.cljs @@ -122,6 +122,7 @@ :border-bottom-right-radius (if timeline 16 (if outgoing 4 16)) :border-width 1 :border-color components.colors/gray-lighter + :background-color components.colors/white :margin-vertical 4}) (def screen-width