fix: disable backspace from the start and delete in the end for query

This commit is contained in:
Tienson Qin
2023-04-03 17:45:53 +08:00
parent 60b2eac6fc
commit 327c29af49

View File

@@ -2693,7 +2693,10 @@
(delete-and-update input selected-start selected-end)
(and end? current-block)
(delete-concat current-block)
(let [editor-state (get-state)
custom-query? (get-in editor-state [:config :custom-query?])]
(when-not custom-query?
(delete-concat current-block)))
:else
(delete-and-update input current-pos (inc current-pos))))))
@@ -2723,11 +2726,13 @@
(delete-and-update input selected-start selected-end))
(zero? current-pos)
(do
(let [editor-state (get-state)
custom-query? (get-in editor-state [:config :custom-query?])]
(util/stop e)
(when (and (if top-block? (string/blank? value) true)
(not root-block?)
(not single-block?))
(not single-block?)
(not custom-query?))
(delete-block! repo false)))
(and (> current-pos 1)