Skip to content

Commit 4ec53db

Browse files
committed
🎨 #15580
1 parent ae9f936 commit 4ec53db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/protyle/util/editorCommonEvent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
871871
if (!target.classList.contains("av__gallery-item--select")) {
872872
blockElement.querySelectorAll(".av__gallery-item--select").forEach(item => {
873873
item.classList.remove("av__gallery-item--select");
874-
})
874+
});
875875
target.classList.add("av__gallery-item--select");
876876
}
877877
const ghostElement = document.createElement("div");
@@ -1102,7 +1102,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
11021102
const items = item.split("@");
11031103
const id = items[0];
11041104
const groupID = items[1] || "";
1105-
const undoPreviousId = blockElement.querySelector(`.av__body${groupID ? `[data-group-id="${groupID}"]` : ""} .av__row[data-id="${id}"]`).previousElementSibling.getAttribute("data-id") || "";
1105+
const undoPreviousId = blockElement.querySelector(`.av__body${groupID ? `[data-group-id="${groupID}"]` : ""} .av__row[data-id="${id}"]`).previousElementSibling?.getAttribute("data-id") || "";
11061106
if (previousID !== id && undoPreviousId !== previousID || (
11071107
(undoPreviousId === "" && previousID === "" && targetGroupID !== groupID)
11081108
)) {
@@ -1181,7 +1181,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
11811181
const items = item.split("@");
11821182
const id = items[0];
11831183
const groupID = items[1] || "";
1184-
const undoPreviousId = blockElement.querySelector(`.av__body[data-group-id="${groupID}"] .av__gallery-item[data-id="${id}"]`).previousElementSibling.getAttribute("data-id") || "";
1184+
const undoPreviousId = blockElement.querySelector(`.av__body[data-group-id="${groupID}"] .av__gallery-item[data-id="${id}"]`).previousElementSibling?.getAttribute("data-id") || "";
11851185
if (previousID !== item && undoPreviousId !== previousID || (
11861186
(undoPreviousId === "" && previousID === "" && targetGroupID !== groupID)
11871187
)) {

0 commit comments

Comments
 (0)