Browse Source

enhance: allow search input to be changed in the sidebar

Tienson Qin 1 year ago
parent
commit
f8630bc641

+ 1 - 1
src/main/frontend/components/cmdk.cljs

@@ -766,7 +766,7 @@
     [:div.cp__cmdk {:ref #(when-not @(::ref state) (reset! (::ref state) %))
                     :class (cond-> "w-full h-full relative flex flex-col justify-start"
                              (not sidebar?) (str " rounded-lg"))}
-     (when-not sidebar? (input-row state all-items))
+     (input-row state all-items)
      [:div {:class (cond-> "w-full flex-1 overflow-y-auto min-h-[65dvh] max-h-[65dvh]"
                      (not sidebar?) (str " pb-14"))
             :ref #(let [*ref (::scroll-container-ref state)]

+ 8 - 6
src/main/frontend/components/right_sidebar.cljs

@@ -274,12 +274,14 @@
                               (context-menu-content db-id idx block-type collapsed? block-count close-fn)))
                [:button.button.close {:title (t :right-side-bar/pane-close)
                                       :on-click #(state/sidebar-remove-block! idx)} (ui/icon "x")]]]
-             [:div.pt-4.p-1 {:role "region"
-                                          :id (str "sidebar-panel-content-" idx)
-                                          :aria-labelledby (str "sidebar-panel-header-" idx)
-                                          :class (util/classnames [{:hidden collapsed?
-                                                                    :initial (not collapsed?)
-                                                                    :p-4 (not (contains? #{:page :block :contents :search} block-type))}])}
+             [:div {:role "region"
+                    :id (str "sidebar-panel-content-" idx)
+                    :aria-labelledby (str "sidebar-panel-header-" idx)
+                    :class (util/classnames [{:hidden collapsed?
+                                              :initial (not collapsed?)
+                                              :p-4 (not (contains? #{:page :block :contents :search} block-type))
+                                              :pt-4 (not (contains? #{:search} block-type))
+                                              :p-1 (not (contains? #{:search} block-type))}])}
               (inner-component component (not drag-from))]
              (when drag-from (drop-area idx))])]
          (drop-indicator idx drag-to)]))))