Browse Source

fix(ux): datepicker interaction within the preview editor

charlie 1 year ago
parent
commit
f0505ca9a8

+ 3 - 3
src/main/frontend/components/property.cljs

@@ -204,7 +204,7 @@
                    (shui/dialog-close!)
                    (and block (= type :checkbox))
                    (p/do!
-                    (shui/popup-hide-all!)
+                    (ui/hide-popups-until-preview-popup!)
                     (pv/<add-property! block (:db/ident property) false {:exit-edit? true}))
                    (and block (= type :default)
                         (not (seq (:property/closed-values property))))
@@ -469,7 +469,7 @@
 
             (= :checkbox type)
             (p/do!
-             (shui/popup-hide-all!)
+             (ui/hide-popups-until-preview-popup!)
              (shui/dialog-close!)
              (pv/<add-property! block (:db/ident property) false {:exit-edit? true}))
 
@@ -495,7 +495,7 @@
       state
       :on-hide (fn [_state _e type]
                  (when (= type :esc)
-                   (shui/popup-hide-all!)
+                   (shui/popup-hide!)
                    (shui/dialog-close!)
                    (when-let [^js input (state/get-input)]
                      (.focus input)))))))

+ 1 - 2
src/main/frontend/components/property/value.cljs

@@ -146,7 +146,6 @@
                            (.focus)) 0)
                  state)
    :will-unmount (fn [state]
-                   (shui/popup-hide!)
                    (shui/dialog-close!)
                    (state/set-editor-action! nil)
                    state)}
@@ -168,7 +167,7 @@
                  (when (fn? on-change)
                    (on-change (db/get-case-page journal)))
                  (shui/popup-hide! id)
-                 (shui/popup-hide!)
+                 (ui/hide-popups-until-preview-popup!)
                  (shui/dialog-close!))))))]
     (shui/calendar
      (cond->