diff --git a/src/quo/components/text_input.cljs b/src/quo/components/text_input.cljs index 63524e31ba..5a9cdc2e0d 100644 --- a/src/quo/components/text_input.cljs +++ b/src/quo/components/text_input.cljs @@ -66,9 +66,9 @@ false))) ;; TODO(Ferossgp): Check performance for android layout animations -;; (when (and platform/android? -;; (aget rn/ui-manager "setLayoutAnimationEnabledExperimental")) -;; (ocall rn/ui-manager "setLayoutAnimationEnabledExperimental" true)) +(when (and platform/android? + (aget rn/ui-manager "setLayoutAnimationEnabledExperimental")) + (ocall rn/ui-manager "setLayoutAnimationEnabledExperimental" true)) (def height 44) ; 22 line-height + 11*2 vertical padding (def multiline-height 88) ; 3 * 22 three line-height + 11* vertical padding @@ -152,11 +152,14 @@ cancel-label on-focus on-blur show-cancel accessibility-label bottom-value secure-text-entry container-style get-ref on-cancel monospace] - :or {cancel-label "Cancel" - show-cancel true} + :or {cancel-label "Cancel"} :as props}] {:pre [(check-spec ::text-input props)]} - (let [after (cond + (let [show-cancel (if (nil? show-cancel) + ;; Enabled by default on iOs and disabled on Android + platform/ios? + show-cancel) + after (cond (and secure-text-entry @visible) {:icon :main-icons/hide :on-press #(reset! visible false)} @@ -190,12 +193,12 @@ :secure-text-entry secure :on-focus (fn [evt] (when on-focus (on-focus evt)) - (when (and platform/ios? show-cancel) + (when show-cancel (rn/configure-next (:ease-in-ease-out rn/layout-animation-presets))) (reset! focused true)) :on-blur (fn [evt] (when on-blur (on-blur evt)) - (when (and platform/ios? show-cancel) + (when show-cancel (rn/configure-next (:ease-in-ease-out rn/layout-animation-presets))) (reset! focused false))} (when (and platform/ios? (not after)) @@ -208,8 +211,7 @@ :secure-text-entry :ref :get-ref))] (when after [accessory-element after])] - (when (and platform/ios? - show-cancel + (when (and show-cancel (not multiline) @focused) [rn/touchable-opacity {:style (cancel-style) diff --git a/src/status_im/ui/components/search_input/view.cljs b/src/status_im/ui/components/search_input/view.cljs index 3b32b30821..ef444c7624 100644 --- a/src/status_im/ui/components/search_input/view.cljs +++ b/src/status_im/ui/components/search_input/view.cljs @@ -15,6 +15,7 @@ :default-value search-filter :auto-focus auto-focus :on-cancel on-cancel + :show-cancel true :auto-correct false :auto-capitalize :none :input-style {:height 36