ats-form-react-pdf-layout 4.4.6 → 4.4.7
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.
- package/lib/index.js +6 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1337,7 +1337,11 @@ const shouldBreak = (child, futureElements, height, previousElements) => {
|
|
|
1337
1337
|
if ('fixed' in child.props)
|
|
1338
1338
|
return false;
|
|
1339
1339
|
const shouldSplit = height < child.box.top + child.box.height;
|
|
1340
|
-
|
|
1340
|
+
// Get the previous sibling from the previous elements for consistent wrap calculation
|
|
1341
|
+
const prevNode = previousElements.length > 0
|
|
1342
|
+
? previousElements[previousElements.length - 1]
|
|
1343
|
+
: child;
|
|
1344
|
+
const canWrap = getWrap(child, prevNode, previousElements);
|
|
1341
1345
|
// Calculate the y coordinate where the desired presence of the child ends
|
|
1342
1346
|
const endOfPresence = getEndOfPresence(child, futureElements);
|
|
1343
1347
|
// If the child is already at the top of the page, breaking won't improve its presence
|
|
@@ -2581,7 +2585,7 @@ const breakableViewChild = (children, height, path = '', currentChildren) => {
|
|
|
2581
2585
|
for (let i = 0; i < children.length; i += 1) {
|
|
2582
2586
|
if (children[i].type !== 'VIEW')
|
|
2583
2587
|
continue;
|
|
2584
|
-
if (shouldBreak(children[i], children.slice(i + 1
|
|
2588
|
+
if (shouldBreak(children[i], children.slice(i + 1), height, currentChildren)) {
|
|
2585
2589
|
return {
|
|
2586
2590
|
child: children[i],
|
|
2587
2591
|
path: `${path}/${i}`,
|