@flozy/editor 10.6.2 → 10.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,12 +32,17 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
32
32
|
function getTextElementHeight(textElement) {
|
33
33
|
let totalHeight = 0;
|
34
34
|
if (textElement) {
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
const {
|
36
|
+
childNodes
|
37
|
+
} = textElement || {};
|
38
|
+
for (let i = childNodes.length - 1; i >= 0; i--) {
|
39
|
+
const el = childNodes[i];
|
40
|
+
const text = el.textContent?.replace(/\n/g, "")?.trim();
|
41
|
+
if (text || totalHeight) {
|
42
|
+
// remove last empty spaces
|
38
43
|
totalHeight += el.offsetHeight || el.getBoundingClientRect().height;
|
39
44
|
}
|
40
|
-
}
|
45
|
+
}
|
41
46
|
}
|
42
47
|
return totalHeight;
|
43
48
|
}
|
@@ -158,11 +163,8 @@ const RnD = props => {
|
|
158
163
|
const textElement = currElement?.querySelector(".fgi_type_text");
|
159
164
|
if (breakpoint && textElement && childType === "text" && !enable) {
|
160
165
|
timerId.current = setTimeout(() => {
|
161
|
-
const {
|
162
|
-
|
163
|
-
} = textElement;
|
164
|
-
// const clientHeight = getTextElementHeight(textElement);
|
165
|
-
|
166
|
+
// const { clientHeight } = textElement;
|
167
|
+
const clientHeight = getTextElementHeight(textElement);
|
166
168
|
const {
|
167
169
|
height
|
168
170
|
} = delta || {};
|