This commit is contained in:
parent
5fa73eedf1
commit
f4c3be9bd0
1 changed files with 4 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue