autoResize: minHeight and maxHeight take CSS units

Closed
RO
19d ago
+145-13

They were read with parseInt, so maxHeight: '60vh' meant 60 pixels. rem, em, vh, vw, vmin and vmax are now converted to pixels on every height update (viewport units follow the window); px, numbers and anything else read as before.


Summary by cubic

Fixes autoResize so minHeight and maxHeight honor CSS units instead of reading them with parseInt (so maxHeight: '60vh' previously capped the editor at 60 pixels).

  • rem, em, vh, vw, vmin and vmax are converted to pixels; viewport units are recalculated on every height update so they follow the window.
  • px, numbers, and unitless strings keep their old behavior, and unsupported values like calc(...) still mean no limit.
  • Type definitions allow string | number | null for both options; null on minHeight removes the built-in 100px default minimum. Unit and type tests cover all cases.