mirror of
https://github.com/status-im/status-react.git
synced 2025-02-10 09:57:15 +00:00
[fix 7617] search bar glitch
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
3584b31747
commit
9634a8ae1b
@ -156,12 +156,22 @@
|
|||||||
:easing (.in (animation/easing)
|
:easing (.in (animation/easing)
|
||||||
(.-quad (animation/easing)))})))
|
(.-quad (animation/easing)))})))
|
||||||
|
|
||||||
|
(defn set-search-state-visible!
|
||||||
|
[visible?]
|
||||||
|
(swap! search-input-state assoc :show? visible?)
|
||||||
|
(animation/set-value (:height @search-input-state)
|
||||||
|
(if visible?
|
||||||
|
styles/search-input-height
|
||||||
|
0)))
|
||||||
|
|
||||||
(defn animated-search-input
|
(defn animated-search-input
|
||||||
[search-filter]
|
[search-filter]
|
||||||
(reagent/create-class
|
(reagent/create-class
|
||||||
{:component-will-unmount
|
{:component-will-unmount
|
||||||
#(do (swap! search-input-state assoc :show? false)
|
#(set-search-state-visible! false)
|
||||||
(animation/set-value (:height @search-input-state) 0))
|
:component-did-mount
|
||||||
|
#(when search-filter
|
||||||
|
(set-search-state-visible! true))
|
||||||
:reagent-render
|
:reagent-render
|
||||||
(fn [search-filter]
|
(fn [search-filter]
|
||||||
(let [{:keys [show? height]} @search-input-state]
|
(let [{:keys [show? height]} @search-input-state]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user