mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
fix: delete at end concats wrong blocks
related to https://github.com/logseq/db-test/issues/347
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
(def enter #(press "Enter"))
|
||||
(def esc #(press "Escape"))
|
||||
(def backspace #(press "Backspace"))
|
||||
(def delete #(press "Delete"))
|
||||
(def tab #(press "Tab"))
|
||||
(def shift+tab #(press "Shift+Tab"))
|
||||
(def shift+enter #(press "Shift+Enter"))
|
||||
|
||||
@@ -65,6 +65,14 @@
|
||||
(is (= "b1" (util/get-edit-content)))
|
||||
(is (= 1 (util/page-blocks-count)))))
|
||||
|
||||
(defn delete-end []
|
||||
(testing "Delete at end"
|
||||
(b/new-blocks ["b1" "b2" "b3"])
|
||||
(k/arrow-up)
|
||||
(k/delete)
|
||||
(is (= "b2b3" (util/get-edit-content)))
|
||||
(is (= 2 (util/page-blocks-count)))))
|
||||
|
||||
(defn delete-test-with-children []
|
||||
(testing "Delete block with its children"
|
||||
(b/new-blocks ["b1" "b2" "b3" "b4"])
|
||||
@@ -88,5 +96,8 @@
|
||||
(deftest delete-test
|
||||
(delete))
|
||||
|
||||
(deftest delete-end-test
|
||||
(delete-end))
|
||||
|
||||
(deftest delete-test-with-children-test
|
||||
(delete-test-with-children))
|
||||
|
||||
@@ -2762,7 +2762,10 @@
|
||||
(let [repo (state/get-current-repo)
|
||||
editor-state (assoc (get-state)
|
||||
:block-id (:block/uuid next-block)
|
||||
:value (:block/title next-block))]
|
||||
:value (:block/title next-block)
|
||||
:block-container (util/get-next-block-non-collapsed
|
||||
(util/rec-get-node (state/get-input) "ls-block")
|
||||
{:exclude-property? true}))]
|
||||
(delete-block-inner! repo editor-state)))))
|
||||
|
||||
(defn keydown-delete-handler
|
||||
|
||||
Reference in New Issue
Block a user