suneditor 3.2.5 → 3.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suneditor",
3
- "version": "3.2.5",
3
+ "version": "3.2.6",
4
4
  "description": "Vanilla JavaScript based WYSIWYG web editor",
5
5
  "author": "Yi JiHong",
6
6
  "license": "MIT",
@@ -531,8 +531,9 @@ class Selection_ {
531
531
  if (topMargin >= 0 && bottomMargin >= 0) return;
532
532
 
533
533
  const newScrollTop = scrollY - (topMargin < 0 ? -(topMargin - PADDING) : bottomMargin);
534
+ const clearTopToolbar = topToolbarH > 0 && topMargin < 0;
534
535
  _w.scrollTo({
535
- top: newScrollTop < scrollY ? newScrollTop - topToolbarH : newScrollTop,
536
+ top: clearTopToolbar ? newScrollTop - topToolbarH : newScrollTop,
536
537
  behavior,
537
538
  });
538
539
  } else {
@@ -549,8 +550,9 @@ class Selection_ {
549
550
  scrollMargin <= PADDING
550
551
  ? scrollY - scrollMargin + PADDING + statusbarHeight
551
552
  : scrollY - scrollMargin + (viewHeight - elH - PADDING);
553
+ const clearTopToolbar = topToolbarH > 0 && !topClear;
552
554
  _w.scrollTo({
553
- top: newScrollTop < scrollY ? newScrollTop - topToolbarH : newScrollTop,
555
+ top: clearTopToolbar ? newScrollTop - topToolbarH : newScrollTop,
554
556
  behavior,
555
557
  });
556
558
  }