mirror of https://github.com/logseq/logseq
enhance: add close button to exit search
parent
de3677ec42
commit
b4c8d8a4a3
|
@ -55,7 +55,7 @@
|
|||
(ui/icon "arrow-up")
|
||||
false
|
||||
(ui/icon "arrow-down")
|
||||
nil))))
|
||||
[:div {:style {:width 18 :height 18}}]))))
|
||||
|
||||
(defn- timestamp-cell-cp
|
||||
[_table row column]
|
||||
|
@ -198,6 +198,7 @@
|
|||
[input {:keys [on-change]}]
|
||||
(let [[show-input? set-show-input!] (rum/use-state false)]
|
||||
(if show-input?
|
||||
[:div.flex.flex-row.items-center
|
||||
(shui/input
|
||||
{:placeholder "Type to search"
|
||||
:auto-focus true
|
||||
|
@ -209,6 +210,12 @@
|
|||
(when (= "Escape" (util/ekey e))
|
||||
(set-show-input! false)))
|
||||
:class "max-w-sm !h-7 !py-0 border-none focus-visible:ring-0 focus-visible:ring-offset-0"})
|
||||
(shui/button
|
||||
{:variant "ghost"
|
||||
:class "text-muted-foreground !px-1"
|
||||
:size :sm
|
||||
:on-click #(set-show-input! false)}
|
||||
(ui/icon "x"))]
|
||||
(shui/button
|
||||
{:variant "ghost"
|
||||
;; FIXME: remove ring when focused
|
||||
|
|
Loading…
Reference in New Issue