Skip to content

Commit

Permalink
fix: remove space tree delete shortcut key (docmost#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipinho authored Oct 12, 2024
1 parent 46d92fb commit fa3c8a0
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,10 @@
"apps/*",
"packages/*"
]
},
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
33 changes: 33 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/dist/module/components/default-container.js b/dist/module/components/default-container.js
index 47724f59b482454fe3144dbb98bd16d3df6a9c17..2285e35ea0073a773b7b74e22758056fd3514c1a 100644
--- a/dist/module/components/default-container.js
+++ b/dist/module/components/default-container.js
@@ -34,28 +34,6 @@ export function DefaultContainer() {
return;
}
if (e.key === "Backspace") {
- if (!tree.props.onDelete)
- return;
- const ids = Array.from(tree.selectedIds);
- if (ids.length > 1) {
- let nextFocus = tree.mostRecentNode;
- while (nextFocus && nextFocus.isSelected) {
- nextFocus = nextFocus.nextSibling;
- }
- if (!nextFocus)
- nextFocus = tree.lastNode;
- tree.focus(nextFocus, { scroll: false });
- tree.delete(Array.from(ids));
- }
- else {
- const node = tree.focusedNode;
- if (node) {
- const sib = node.nextSibling;
- const parent = node.parent;
- tree.focus(sib || parent, { scroll: false });
- tree.delete(node);
- }
- }
return;
}
if (e.key === "Tab" && !e.shiftKey) {
9 changes: 7 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fa3c8a0

Please sign in to comment.