mirror of https://github.com/logseq/logseq
fix: disable all the editing commands when focusing on the dialog
parent
2bad23404e
commit
5bd2f9cedc
|
@ -1,7 +1,8 @@
|
|||
(ns frontend.mixins
|
||||
(:require [rum.core :as rum]
|
||||
[goog.dom :as dom]
|
||||
[frontend.util :refer [profile]])
|
||||
[frontend.util :refer [profile]]
|
||||
[frontend.state :as state])
|
||||
(:import [goog.events EventHandler]))
|
||||
|
||||
(defn detach
|
||||
|
@ -162,6 +163,15 @@
|
|||
(handler (:rum/args state))
|
||||
state)})
|
||||
|
||||
(def component-editing-mode
|
||||
{:will-mount
|
||||
(fn [state]
|
||||
(state/set-block-component-editing-mode! true)
|
||||
state)
|
||||
:will-unmount
|
||||
(fn [state]
|
||||
(state/set-block-component-editing-mode! false)
|
||||
state)})
|
||||
|
||||
(defn perf-measure-mixin
|
||||
[desc]
|
||||
|
|
|
@ -1059,8 +1059,6 @@
|
|||
([modal-panel-content]
|
||||
(set-modal! modal-panel-content false))
|
||||
([modal-panel-content fullscreen?]
|
||||
;; Temporal fix: to avoid deleting selected blocks (backspace in input/textarea)
|
||||
(clear-selection!)
|
||||
(swap! state assoc
|
||||
:modal/show? (boolean modal-panel-content)
|
||||
:modal/panel-content modal-panel-content
|
||||
|
|
|
@ -466,6 +466,7 @@
|
|||
(panel-content close-fn)]])
|
||||
|
||||
(rum/defc modal < rum/reactive
|
||||
mixins/component-editing-mode
|
||||
(mixins/event-mixin
|
||||
(fn [state]
|
||||
(mixins/hide-when-esc-or-outside
|
||||
|
|
Loading…
Reference in New Issue