|
112 | 112 | (letsubs [{:keys [group-chat public? input-text]} [:get-current-chat] |
113 | 113 | show-bottom-info? [:get-current-chat-ui-prop :show-bottom-info?] |
114 | 114 | current-view [:get :view-id]] |
115 | | - [react/view {:style style/chat-view |
116 | | - :on-layout (fn [e] |
117 | | - (re-frame/dispatch [:set :layout-height (-> e .-nativeEvent .-layout .-height)]))} |
118 | | - [chat-toolbar public?] |
119 | | - (when (= :chat current-view) |
120 | | - [messages-view-animation |
121 | | - [messages-view group-chat]]) |
122 | | - [input/container {:text-empty? (string/blank? input-text)}] |
123 | | - (when show-bottom-info? |
124 | | - [bottom-info/bottom-info-view]) |
125 | | - [connectivity/error-view {:top (get platform/platform-specific :status-bar-default-height)}]])) |
| 115 | + ;; this scroll-view is a hack that allows us to use on-blur and on-focus on Android |
| 116 | + ;; more details here: https://github.com/facebook/react-native/issues/11071 |
| 117 | + [react/scroll-view {:scroll-enabled false |
| 118 | + :style style/scroll-root |
| 119 | + :content-container-style style/scroll-root |
| 120 | + :keyboard-should-persist-taps :handled} |
| 121 | + [react/view {:style style/chat-view |
| 122 | + :on-layout (fn [e] |
| 123 | + (re-frame/dispatch [:set :layout-height (-> e .-nativeEvent .-layout .-height)]))} |
| 124 | + [chat-toolbar public?] |
| 125 | + (when (= :chat current-view) |
| 126 | + [messages-view-animation |
| 127 | + [messages-view group-chat]]) |
| 128 | + [input/container {:text-empty? (string/blank? input-text)}] |
| 129 | + (when show-bottom-info? |
| 130 | + [bottom-info/bottom-info-view]) |
| 131 | + [connectivity/error-view {:top (get platform/platform-specific :status-bar-default-height)}]]])) |
0 commit comments