From 284f9bffed8f22b9c476802f55c447c9105b50c0 Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Mon, 30 Sep 2019 14:26:11 +0200 Subject: [PATCH] [#8937] Recent stickers are shown when stickers tab is highlighted Signed-off-by: Andrey Shovkoplyas --- .../ui/screens/chat/stickers/views.cljs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/status_im/ui/screens/chat/stickers/views.cljs b/src/status_im/ui/screens/chat/stickers/views.cljs index 74247f4ab4..2cba0ba85b 100644 --- a/src/status_im/ui/screens/chat/stickers/views.cljs +++ b/src/status_im/ui/screens/chat/stickers/views.cljs @@ -64,12 +64,16 @@ (defn update-scroll-position [ref installed-packs selected-pack window-width] (when ref - (let [x (if (= selected-pack :recent) - 0 - (* (inc (some #(when (= selected-pack (:id (second %))) (first %)) - (map-indexed vector installed-packs))) - window-width))] - (.scrollTo ref (clj->js {:x x :animated true}))))) + ;; bug on Android https://github.com/facebook/react-native/issues/24531 + (js/setTimeout + (fn [] + (let [x (if (= selected-pack :recent) + 0 + (* (inc (some #(when (= selected-pack (:id (second %))) (first %)) + (map-indexed vector installed-packs))) + window-width))] + (.scrollTo ref #js {:x x :animated true}))) + 200))) (defn on-scroll [e installed-packs window-width] (let [num (/ (.-nativeEvent.contentOffset.x e) window-width)