|
@@ -12,7 +12,8 @@ import {
|
|
|
focusByWbr,
|
|
|
focusSideBlock,
|
|
|
getEditorRange,
|
|
|
- getSelectionOffset, setLastNodeRange,
|
|
|
+ getSelectionOffset,
|
|
|
+ setLastNodeRange,
|
|
|
} from "../util/selection";
|
|
|
import {Constants} from "../../constants";
|
|
|
import {getSearch, isMobile} from "../../util/functions";
|
|
@@ -25,10 +26,12 @@ import {dropEvent} from "../util/editorCommonEvent";
|
|
|
import {input} from "./input";
|
|
|
import {
|
|
|
getContenteditableElement,
|
|
|
- getLastBlock, getNextBlock,
|
|
|
+ getLastBlock,
|
|
|
+ getNextBlock,
|
|
|
getPreviousHeading,
|
|
|
getTopAloneElement,
|
|
|
- hasNextSibling, hasPreviousSibling,
|
|
|
+ hasNextSibling,
|
|
|
+ hasPreviousSibling,
|
|
|
isNotEditBlock
|
|
|
} from "./getBlock";
|
|
|
import {transaction, updateTransaction} from "./transaction";
|
|
@@ -568,6 +571,9 @@ export class WYSIWYG {
|
|
|
}
|
|
|
newHeight = y - newTop;
|
|
|
}
|
|
|
+ if (newHeight < 4) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
protyle.selectElement.setAttribute("style", `background-color: ${protyle.selectElement.style.backgroundColor};top:${newTop}px;height:${newHeight}px;left:${newLeft + 2}px;width:${newWidth - 2}px;`);
|
|
|
const newMouseElement = document.elementFromPoint(moveEvent.clientX, moveEvent.clientY);
|
|
|
if (mouseElement && mouseElement.isSameNode(newMouseElement) && !mouseElement.classList.contains("protyle-wysiwyg") &&
|