|
@@ -96,12 +96,14 @@ export const getTopEmptyElement = (element: Element) => {
|
|
|
if (!topElement.parentElement.getAttribute("data-node-id")) {
|
|
|
topElement = topElement.parentElement;
|
|
|
} else {
|
|
|
- const hasText = Array.from(topElement.parentElement.querySelectorAll('[contenteditable="true"]')).find(item => {
|
|
|
+ let hasText = false
|
|
|
+ Array.from(topElement.parentElement.querySelectorAll('[contenteditable="true"]')).find(item => {
|
|
|
if (item.textContent.replace(Constants.ZWSP, "").replace("\n", "") !== "") {
|
|
|
+ hasText = true;
|
|
|
return true;
|
|
|
}
|
|
|
});
|
|
|
- if (!hasText || topElement.previousElementSibling?.getAttribute("data-node-id") ||
|
|
|
+ if (hasText || topElement.previousElementSibling?.getAttribute("data-node-id") ||
|
|
|
topElement.nextElementSibling?.getAttribute("data-node-id")) {
|
|
|
break;
|
|
|
} else {
|