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
| Option | Type | Default | Description |
|---|---|---|---|
autoresize_overflow_padding | number | 1 | Padding in pixels added to the left and right sides of the editor body. |
autoresize_bottom_margin | number | 50 | Extra 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
| Command | Description |
|---|---|
editor42AutoResize | Manually triggers a resize calculation and applies the new height. |
Events
| Event | Description |
|---|---|
ResizeEditor | Fired whenever the editor container height is changed by the resize logic. |