You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>This demo shows the autoresize plugin in action. The editor automatically adjusts its height based on content. Try adding or removing content to see the dynamic resizing behavior.</p>
5
+
<div>
6
+
<div><strong>How it works:</strong></div>
7
+
<ul>
8
+
<li>Type or paste content to see the editor expand</li>
9
+
<li>Delete content to see the editor shrink</li>
10
+
<li>The editor respects min/max height set limits</li>
This plugin automatically resizes the editor to the content inside it. It is typically used to prevent the editor from expanding infinitely as a user types into the editable area. For example, by giving the `+max_height+` option a value the editor will stop resizing when the set value is reached.
9
+
The {pluginname} plugin automatically adjusts the editor height to match its content. This creates a more intuitive editing experience where the editor grows and shrinks naturally with content. Setting the `+max_height+` option would allow you to still control when the content would become scrollable.
10
+
11
+
== Interactive demo
12
+
13
+
liveDemo::autoresize[]
10
14
11
15
== Basic setup
12
16
@@ -18,9 +22,18 @@ tinymce.init({
18
22
});
19
23
----
20
24
25
+
== How it works
26
+
27
+
The Autoresize plugin monitors content changes and automatically adjusts the editor height to accommodate the content. When enabled:
28
+
29
+
* The editor initializes and renders based on the minimum height specified by `+min_height+` option.
30
+
* As content is added, the editor expands vertically
31
+
* The editor stops expanding when it reaches the `+max_height+` limit
32
+
* The `+resize+` handle is removed from the editor.
33
+
21
34
== Options
22
35
23
-
These settings affect the execution of the Autoresize plugin, including changes to the minimum width, height, bottom margin, and default initialization state.
36
+
These settings control the autoresize behavior, including height limits, padding, and margins.
Copy file name to clipboardExpand all lines: modules/ROOT/partials/configuration/autoresize_bottom_margin.adoc
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,20 @@ This option allows you to specify the size of the `+padding+` at the bottom of t
5
5
6
6
*Type:* `+Number+`
7
7
8
-
=== Example: using `+autoresize_bottom_margin+`
8
+
*Default value:* `+50+`
9
+
10
+
=== Example: adding bottom margin for better content spacing
9
11
10
12
[source,js]
11
13
----
12
14
tinymce.init({
13
15
selector: 'textarea', // change this value according to your HTML
14
16
plugins: 'autoresize',
15
-
autoresize_bottom_margin: 50
17
+
autoresize_bottom_margin: 60 // 50px is the default value
16
18
});
17
19
----
18
20
19
-
As of version 6.3, `autoresize_bottom_margin` must be set to a value below the `+margin-bottom+` property of any content CSS, else it will be ignored and set to `+0+`.
20
-
21
-
=== Example: setting `+autoresize_bottom_margin+` to zero because `+margin-bottom+` is set elsewhere
Copy file name to clipboardExpand all lines: modules/ROOT/partials/configuration/max_height.adoc
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
[[max_height]]
2
2
== `+max_height+`
3
3
4
-
The `+max_height+` option has two kinds of behaviors depending on the state of the xref:autoresize.adoc[`+autoresize+`] plugin:
4
+
The `+max_height+` option has different behaviors depending on whether the xref:autoresize.adoc[`+autoresize+`] plugin is enabled:
5
5
6
-
* `+autoresize+` OFF (Default): Without the `+autoresize+` plugin, this option sets the maximum height that a user can stretch the entire {productname} interface (by grabbing the draggable area in the bottomright of the editor interface).
7
-
* `+autoresize+` ON: With the `+autoresize+` plugin, this option sets the maximum height the editor can automatically expand to.
6
+
* **Without `+autoresize+` plugin**: Sets the maximum height that users can manually resize the entire {productname} interface by dragging the resize handle in the bottom-right corner.
7
+
* **With `+autoresize+` plugin**: Sets the maximum height the editor can automatically expand to when content is added.
selector: 'textarea', // change this value according to your HTML
27
27
plugins: 'autoresize',
28
-
max_height: 500
28
+
max_height: 600
29
29
});
30
30
----
31
31
endif::[]
32
32
33
-
NOTE: If the xref:editor-size-options.adoc#resize[`+resize+`] option is set to `+false+` the resize handle will be disabled and a user will not be able to resize the editor (by manual dragging). Note that `+resize+` defaults to `+false+` when the `+autoresize+` plugin is enabled.
33
+
[NOTE]
34
+
====
35
+
* If the xref:editor-size-options.adoc#resize[`+resize+`] option is set to `+false+`, the resize handle will be disabled and users cannot manually resize the editor.
36
+
* The `+resize+` option defaults to `+false+` when the `+autoresize+` plugin is enabled.
37
+
* Values are specified in pixels without units.
38
+
* If `+max_height+` is not set when using the `+autoresize+` plugin, the editor will default to the standard `+max_height+` behavior (unlimited height expansion).
Copy file name to clipboardExpand all lines: modules/ROOT/partials/configuration/min_height.adoc
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
[[min_height]]
2
2
== `+min_height+`
3
3
4
-
The *min_height* option has two kinds of behaviors depending on the state of the xref:autoresize.adoc[`+autoresize+`] plugin:
4
+
The `+min_height+` option has different behaviors depending on whether the xref:autoresize.adoc[`+autoresize+`] plugin is enabled:
5
5
6
-
* `+autoresize+` OFF (Default): Without the `+autoresize+` plugin, this option sets the minimum height that a user can shrink the entire {productname} interface (by grabbing the draggable area in the bottomright of the editor interface).
7
-
* `+autoresize+` ON: With the `+autoresize+` plugin, this option sets the minimum height the editor can automatically shrink to.
6
+
* **Without `+autoresize+` plugin**: Sets the minimum height that users can manually shrink the entire {productname} interface by dragging the resize handle in the bottom-right corner.
7
+
* **With `+autoresize+` plugin**: Sets the minimum height the editor can automatically shrink to when content is removed.
8
8
9
9
*Type:* `+Number+`
10
10
@@ -32,4 +32,11 @@ tinymce.init({
32
32
----
33
33
endif::[]
34
34
35
-
NOTE: If the xref:editor-size-options.adoc#resize[`+resize+`] option is set to `+false+` the resize handle will be disabled and a user will not be able to resize the editor (by manual dragging). Note that `+resize+` defaults to `+false+` when the `+autoresize+` plugin is enabled.
35
+
[NOTE]
36
+
====
37
+
* If the xref:editor-size-options.adoc#resize[`+resize+`] option is set to `+false+`, the resize handle will be disabled and users cannot manually resize the editor.
38
+
* The `+resize+` option defaults to `+false+` when the `+autoresize+` plugin is enabled.
39
+
* Values are specified in pixels without units.
40
+
* Setting `+min_height+` too low may cause usability issues on mobile devices.
41
+
* If `+min_height+` is not set when using the `+autoresize+` plugin, the editor will default to the standard `+min_height+` value of `+100+` pixels.
0 commit comments