Vanessa 2023-10-05 20:30:20 +08:00
parent 90432f818a
commit e1d8a609d0
2 changed files with 9 additions and 4 deletions

View file

@ -1471,8 +1471,13 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
}
if (matchHotKey("⌘C", event) && selectText === "") {
const selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
if (selectElements.length === 0) {
nodeElement.classList.add("protyle-wysiwyg--select");
selectElements.push(nodeElement);
}
let html = "";
protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select").forEach(item => {
selectElements.forEach(item => {
html += removeEmbed(item);
});
if (html !== "") {

View file

@ -203,7 +203,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
action: "delete",
id,
});
sideElement = getPreviousBlock(topElement) || getNextBlock(topElement) || topElement.parentElement || protyle.wysiwyg.element.firstElementChild;
sideElement = getNextBlock(topElement) || getPreviousBlock(topElement) || topElement.parentElement || protyle.wysiwyg.element.firstElementChild;
if (topElement.getAttribute("data-type") === "NodeHeading" && topElement.getAttribute("fold") === "1") {
// https://github.com/siyuan-note/siyuan/issues/2188
setFold(protyle, topElement, undefined, true);
@ -268,8 +268,8 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
sideElement = undefined;
focusByWbr(emptyElement, range);
}
focusBlock(sideElement, undefined, false);
// https://github.com/siyuan-note/siyuan/issues/5485
focusBlock(sideElement);
scrollCenter(protyle, sideElement);
if (listElement) {
inserts.push({