Fix mentions animation when disappearing (#15879)

* fix: suggestions list animation
This commit is contained in:
Omar Basem 2023-05-11 22:33:25 +04:00 committed by GitHub
parent c71224e73e
commit 264b7ffab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -30,7 +30,7 @@
user])
(defn- f-view
[suggestions-atom props state animations {:keys [reply edit images]} max-height cursor-pos]
[suggestions-atom props state animations max-height cursor-pos images reply edit]
(let [suggestions (rf/sub [:chat/mention-suggestions])
opacity (reanimated/use-shared-value (if (seq suggestions) 1 0))
size (count suggestions)
@ -38,9 +38,9 @@
:insets (safe-area/get-insets)
:curr-height (reanimated/get-shared-value (:height animations))
:window-height (:height (rn/get-window))
:images images
:reply reply
:edit edit
:images images}
:edit edit}
mentions-pos (utils/calc-suggestions-position cursor-pos max-height size state data)]
(rn/use-effect
(fn []
@ -61,6 +61,6 @@
:accessibility-label :mentions-list}]]))
(defn view
[props state animations subs max-height cursor-pos]
[props state animations max-height cursor-pos images reply edit]
(let [suggestions-atom (reagent/atom {})]
[:f> f-view suggestions-atom props state animations subs max-height cursor-pos]))
[:f> f-view suggestions-atom props state animations max-height cursor-pos images reply edit]))

View File

@ -62,7 +62,8 @@
(effects/edit-mentions props state subs)
[:<>
[sub-view/shell-button state animations subs]
[mentions/view props state animations subs max-height cursor-pos]
[mentions/view props state animations max-height cursor-pos (:images subs) (:reply subs)
(:edit subs)]
[gesture/gesture-detector
{:gesture (drag-gesture/drag-gesture props state animations dimensions keyboard-shown)}
[reanimated/view