overtype 2.3.3 → 2.3.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.
package/dist/overtype.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * OverType v2.3.3
2
+ * OverType v2.3.4
3
3
  * A lightweight markdown editor library with perfect WYSIWYG alignment
4
4
  * @license MIT
5
5
  * @author David Miranda
@@ -1704,6 +1704,11 @@ var OverType = (() => {
1704
1704
  cursor: text !important;
1705
1705
  }
1706
1706
 
1707
+ .overtype-container.overtype-auto-resize[data-mode="preview"] .overtype-preview {
1708
+ position: static !important;
1709
+ height: auto !important;
1710
+ }
1711
+
1707
1712
  /* Hide syntax markers in preview mode */
1708
1713
  .overtype-container[data-mode="preview"] .syntax-marker {
1709
1714
  display: none !important;
@@ -5611,11 +5616,18 @@ ${blockSuffix}` : suffix;
5611
5616
  const preview = this.preview;
5612
5617
  const wrapper = this.wrapper;
5613
5618
  const isPreviewMode = this.container.dataset.mode === "preview";
5614
- const scrollTop = isPreviewMode ? preview.scrollTop : textarea.scrollTop;
5619
+ if (isPreviewMode) {
5620
+ wrapper.style.removeProperty("height");
5621
+ preview.style.removeProperty("height");
5622
+ preview.style.removeProperty("overflow-y");
5623
+ textarea.style.removeProperty("height");
5624
+ textarea.style.removeProperty("overflow-y");
5625
+ return;
5626
+ }
5627
+ const scrollTop = textarea.scrollTop;
5615
5628
  wrapper.style.setProperty("height", "auto", "important");
5616
- preview.style.setProperty("height", "auto", "important");
5617
5629
  textarea.style.setProperty("height", "auto", "important");
5618
- let newHeight = isPreviewMode ? preview.scrollHeight : textarea.scrollHeight;
5630
+ let newHeight = textarea.scrollHeight;
5619
5631
  if (this.options.minHeight) {
5620
5632
  const minHeight = parseInt(this.options.minHeight);
5621
5633
  newHeight = Math.max(newHeight, minHeight);