only update toolbar when keyboard re-displays

pull/5991/head
llcc 2022-07-11 21:50:25 +08:00 committed by Andelf
parent 351a7f871e
commit 961fde743e
2 changed files with 3 additions and 9 deletions

View File

@ -49,8 +49,7 @@
(set-command-stats icon)) (set-command-stats icon))
(if event? (if event?
(command-handler e) (command-handler e)
(command-handler)) (command-handler)))}
(state/set-state! :mobile/toolbar-update-observer (rand-int 1000000)))}
(ui/icon icon {:style {:fontSize ui/icon-size}})]]) (ui/icon icon {:style {:fontSize ui/icon-size}})]])
(rum/defc timestamp-submenu (rum/defc timestamp-submenu
@ -70,7 +69,6 @@
{:on-mouse-down (fn [event] {:on-mouse-down (fn [event]
(util/stop event) (util/stop event)
(set-command-stats :calendar) (set-command-stats :calendar)
(state/set-state! :mobile/toolbar-update-observer (rand-int 1000000))
(let [target (gdom/getNextElementSibling (.-target event))] (let [target (gdom/getNextElementSibling (.-target event))]
(dom/add-class! target "show-submenu")))} (dom/add-class! target "show-submenu")))}
(ui/icon "calendar" {:style {:fontSize ui/icon-size}}) (ui/icon "calendar" {:style {:fontSize ui/icon-size}})
@ -118,8 +116,7 @@
[] []
(when (and (state/sub :editor/editing?) (when (and (state/sub :editor/editing?)
(or (state/sub :mobile/show-toolbar?) (or (state/sub :mobile/show-toolbar?)
(mobile-util/native-ipad?)) (mobile-util/native-ipad?)))
(state/sub :mobile/toolbar-update-observer))
(when-let [config-toolbar-stats (:mobile/toolbar-stats (state/get-config))] (when-let [config-toolbar-stats (:mobile/toolbar-stats (state/get-config))]
(reset! commands-stats config-toolbar-stats)) (reset! commands-stats config-toolbar-stats))
(let [parent-id (state/get-edit-input-id) (let [parent-id (state/get-edit-input-id)

View File

@ -148,11 +148,8 @@
:mobile/actioned-block nil :mobile/actioned-block nil
:mobile/show-toolbar? false :mobile/show-toolbar? false
:mobile/show-recording-bar? false :mobile/show-recording-bar? false
;;; toolbar icon doesn't update correctly when clicking after separate it from box,
;;; add a random in (<= 1000000) to observer its update
:mobile/toolbar-update-observer 0
:mobile/show-tabbar? false :mobile/show-tabbar? false
;; plugin ;; plugin
:plugin/enabled (and (util/electron?) :plugin/enabled (and (util/electron?)
;; true false :theme-only ;; true false :theme-only