Skip to main content

Autoresize

Plugin alias: autoresize

editor42.init({
plugins: 'autoresize'
});

Automatically adjusts the height of the editor iframe to fit its content, eliminating the need for a scrollbar within the editing area. Recalculates height on content changes and respects minimum/maximum height constraints. When content exceeds the maximum height, scrolling is re-enabled. Only works in iframe mode, not inline.

Options

OptionTypeDefaultDescription
autoresize_overflow_paddingnumber1Padding in pixels added to the left and right sides of the editor body.
autoresize_bottom_marginnumber50Extra margin in pixels added below the content.

This plugin also respects the core options min_height and max_height to constrain the resize range.

Commands

CommandDescription
editor42AutoResizeManually triggers a resize calculation and applies the new height.

Events

EventDescription
ResizeEditorFired whenever the editor container height is changed by the resize logic.