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/README.md CHANGED
@@ -69,7 +69,7 @@ npm install overtype
69
69
 
70
70
  ### CDN
71
71
  ```html
72
- <script src="https://unpkg.com/overtype/dist/overtype.min.js"></script>
72
+ <script src="https://cdn.jsdelivr.net/npm/overtype@latest/dist/overtype.min.js"></script>
73
73
  ```
74
74
 
75
75
  ## Quick Start
@@ -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
@@ -1678,6 +1678,11 @@ function generateStyles(options = {}) {
1678
1678
  cursor: text !important;
1679
1679
  }
1680
1680
 
1681
+ .overtype-container.overtype-auto-resize[data-mode="preview"] .overtype-preview {
1682
+ position: static !important;
1683
+ height: auto !important;
1684
+ }
1685
+
1681
1686
  /* Hide syntax markers in preview mode */
1682
1687
  .overtype-container[data-mode="preview"] .syntax-marker {
1683
1688
  display: none !important;
@@ -5585,11 +5590,18 @@ var _OverType = class _OverType {
5585
5590
  const preview = this.preview;
5586
5591
  const wrapper = this.wrapper;
5587
5592
  const isPreviewMode = this.container.dataset.mode === "preview";
5588
- const scrollTop = isPreviewMode ? preview.scrollTop : textarea.scrollTop;
5593
+ if (isPreviewMode) {
5594
+ wrapper.style.removeProperty("height");
5595
+ preview.style.removeProperty("height");
5596
+ preview.style.removeProperty("overflow-y");
5597
+ textarea.style.removeProperty("height");
5598
+ textarea.style.removeProperty("overflow-y");
5599
+ return;
5600
+ }
5601
+ const scrollTop = textarea.scrollTop;
5589
5602
  wrapper.style.setProperty("height", "auto", "important");
5590
- preview.style.setProperty("height", "auto", "important");
5591
5603
  textarea.style.setProperty("height", "auto", "important");
5592
- let newHeight = isPreviewMode ? preview.scrollHeight : textarea.scrollHeight;
5604
+ let newHeight = textarea.scrollHeight;
5593
5605
  if (this.options.minHeight) {
5594
5606
  const minHeight = parseInt(this.options.minHeight);
5595
5607
  newHeight = Math.max(newHeight, minHeight);