fix: alias delete not working

This commit is contained in:
Tienson Qin
2020-11-05 23:46:05 +08:00
parent 8edff5ec0c
commit 87f31c1b9f
3 changed files with 26 additions and 30 deletions

View File

@@ -302,21 +302,21 @@
[:input.form-input.block.w-full.pl-2.sm:text-sm.sm:leading-5
(merge
(cond->
{:key (str "modal-input-" (name id))
:id (str "modal-input-" (name id))
:type (or type "text")
:on-change (fn [e]
(swap! input-value assoc id (util/evalue e)))
:auto-complete (if (util/chrome?) "chrome-off" "off")}
{:key (str "modal-input-" (name id))
:id (str "modal-input-" (name id))
:type (or type "text")
:on-change (fn [e]
(swap! input-value assoc id (util/evalue e)))
:auto-complete (if (util/chrome?) "chrome-off" "off")}
placeholder
(assoc :placeholder placeholder))
(dissoc input-item :id))]])
(ui/button
"Submit"
:on-click
(fn [e]
(util/stop e)
(on-submit command @input-value pos)))])))))
"Submit"
:on-click
(fn [e]
(util/stop e)
(on-submit command @input-value pos)))])))))
(rum/defc absolute-modal < rum/static
[cp set-default-width? {:keys [top left]}]
@@ -638,17 +638,17 @@
(let [target (.-target e)]
(when-not (d/has-class? target "bottom-action")
(let [{:keys [on-hide format value block id repo dummy?]} (get-state state)]
(when on-hide
(on-hide value event))
(when
(or (= event :esc)
(= event :visibilitychange)
(and (= event :click)
(not (editor-handler/in-auto-complete? (gdom/getElement id)))))
(state/clear-edit!))))))
(when on-hide
(on-hide value event))
(when
(or (= event :esc)
(= event :visibilitychange)
(and (= event :click)
(not (editor-handler/in-auto-complete? (gdom/getElement id)))))
(state/clear-edit!))))))
:node (gdom/getElement id)
;; :visibilitychange? true
))
))
100)
(when-let [element (gdom/getElement id)]