Skip to content

Commit 3fb8bda

Browse files
committed
DOC-3147: The ToggleToolbarDrawer command's skipFocus option has been deprecated.
1 parent b3a9cdd commit 3fb8bda

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

modules/ROOT/pages/8.0-release-notes.adoc

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
= {productname} {release-version}
32
:release-version: 8.0.0
43
:navtitle: {productname} {release-version}
@@ -104,6 +103,19 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
104103

105104
// CCFR here.
106105

106+
=== Added support for `skip_focus` option in ToggleToolbarDrawer command
107+
// #TINY-12044
108+
109+
The `ToggleToolbarDrawer` command now supports the standard `skip_focus` option, which allows opening the toolbar drawer without focusing the editor. This provides consistent behavior with other editor commands.
110+
111+
.Updated new `skip_focus` option usage command
112+
[source]
113+
----
114+
editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true });
115+
----
116+
117+
For more information on the `ToggleToolbarDrawer` command, see: xref:editor-command-identifiers.adoc[Available Commands].
118+
107119

108120
[[additions]]
109121
== Additions
@@ -170,6 +182,26 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
170182

171183
// CCFR here.
172184

185+
=== The `ToggleToolbarDrawer` command's `skipFocus` option has been deprecated
186+
// #TINY-12044
187+
188+
The `ToggleToolbarDrawer` command previously accepted a non-standard `skipFocus` option to prevent the editor from receiving focus when the command was executed. This behavior differed from other editor commands, which use the generic `skip_focus` option for the same purpose. As a result, the inconsistency lead to confusion when implementing or maintaining command logic.
189+
190+
To resolve this, support for the standard `skip_focus` option has been added to the `ToggleToolbarDrawer` command. The `skipFocus` option is now **deprecated** in {productname} {release-version} and will be removed in a future release.
191+
192+
.Before deprecation using the `skipFocus` option
193+
[source]
194+
----
195+
editor.execCommand('ToggleToolbarDrawer', false, { skipFocus: true });
196+
----
197+
198+
.After deprecation using the `skip_focus` option
199+
[source]
200+
----
201+
editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true });
202+
----
203+
204+
This change improves consistency across commands and aligns with expected usage patterns in {productname} {release-version}.
173205

174206
[[known-issues]]
175207
== Known issues

modules/ROOT/pages/editor-command-identifiers.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ The commands in the following table are provided by the {productname} editor and
155155
|mceTogglePlainTextPaste |Toggles paste as plain text.
156156
|mceToggleVisualAid |Toggles the visual aids for: tables without borders and anchors.
157157
|ToggleSidebar |Closes the current sidebar, or toggles the sidebar if the sidebar name is provided as a value (`_<sidebar-name>_`).
158-
|ToggleToolbarDrawer |Toggles the Toolbar Drawer. For information on toolbars, see: xref:toolbar-configuration-options.adoc#toolbar[User interface options - Toolbar].
158+
|ToggleToolbarDrawer |Toggles the Toolbar Drawer. Can be used with the `skip_focus` option to prevent focusing the editor. For information on toolbars, see: xref:toolbar-configuration-options.adoc#toolbar[User interface options - Toolbar].
159159
|===
160160

161161
.Examples
@@ -199,7 +199,7 @@ tinymce.activeEditor.execCommand('mceTogglePlainTextPaste');
199199
tinymce.activeEditor.execCommand('mceToggleVisualAid');
200200
tinymce.activeEditor.execCommand('ToggleSidebar'); /* OR */
201201
tinymce.activeEditor.execCommand('ToggleSidebar', false, '<sidebar-name>');
202-
tinymce.activeEditor.execCommand('ToggleToolbarDrawer');
202+
tinymce.activeEditor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true });
203203
----
204204

205205
[[core-table-commands]]
@@ -614,7 +614,7 @@ The following command states can be queried using the xref:apis/tinymce.editor.a
614614
|Strikethrough |Returns `+true+` if the content is formatted using the same markup as the {productname} `+Strikethrough+` command.
615615
|Subscript |Returns `+true+` if the content is formatted using the same markup as the {productname} `+Subscript+` command.
616616
|Superscript |Returns `+true+` if the content is formatted using the same markup as the {productname} `+Superscript+` command.
617-
|ToggleToolbarDrawer |Returns `+true+` if the Toolbar Drawer is open. The state can be controlled by the {productname} `+ToggleToolbarDrawer+` command.
617+
|ToggleToolbarDrawer |Returns `+true+` if the Toolbar Drawer is open. The state can be controlled by the {productname} `+ToggleToolbarDrawer+` command. When controlling the state, use the `skip_focus` option (recommended) instead of the deprecated `skipFocus` option.
618618
|Underline |Returns `+true+` if the content is formatted using the same markup as the {productname} `+Underline+` command.
619619
|===
620620

0 commit comments

Comments
 (0)