slate-angular 20.2.3 → 20.2.4

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.
@@ -1506,7 +1506,6 @@ const getRealHeightByElement = (editor, element, defaultHeight) => {
1506
1506
  const buildHeightsAndAccumulatedHeights = (editor) => {
1507
1507
  const children = (editor.children || []);
1508
1508
  const heights = new Array(children.length);
1509
- const visibleStates = new Array(children.length);
1510
1509
  const accumulatedHeights = new Array(children.length + 1);
1511
1510
  accumulatedHeights[0] = 0;
1512
1511
  for (let i = 0; i < children.length; i++) {
@@ -1514,7 +1513,7 @@ const buildHeightsAndAccumulatedHeights = (editor) => {
1514
1513
  heights[i] = height;
1515
1514
  accumulatedHeights[i + 1] = accumulatedHeights[i] + height;
1516
1515
  }
1517
- return { heights, accumulatedHeights, visibleStates };
1516
+ return { heights, accumulatedHeights };
1518
1517
  };
1519
1518
  const calculateVirtualTopHeight = (editor, startIndex) => {
1520
1519
  const { accumulatedHeights } = buildHeightsAndAccumulatedHeights(editor);
@@ -3899,7 +3898,7 @@ class SlateEditable {
3899
3898
  }, 100);
3900
3899
  }
3901
3900
  const adjustedScrollTop = Math.max(0, scrollTop - getBusinessTop(this.editor));
3902
- const { heights, accumulatedHeights, visibleStates } = buildHeightsAndAccumulatedHeights(this.editor);
3901
+ const { heights, accumulatedHeights } = buildHeightsAndAccumulatedHeights(this.editor);
3903
3902
  const totalHeight = accumulatedHeights[elementLength];
3904
3903
  const maxScrollTop = Math.max(0, totalHeight - viewportHeight);
3905
3904
  const limitedScrollTop = Math.min(adjustedScrollTop, maxScrollTop);
@@ -3911,7 +3910,8 @@ class SlateEditable {
3911
3910
  for (let i = 0; i < elementLength && accumulatedOffset < viewBottom; i++) {
3912
3911
  const currentHeight = heights[i];
3913
3912
  const nextOffset = accumulatedOffset + currentHeight;
3914
- if (!visibleStates[i]) {
3913
+ const isVisible = this.editor.isVisible(children[i]);
3914
+ if (!isVisible) {
3915
3915
  accumulatedOffset = nextOffset;
3916
3916
  continue;
3917
3917
  }