From 3fb8bda0134abd99df7a5cbb3508217d1424a23a Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 4 Jun 2025 13:22:59 +1000 Subject: [PATCH] DOC-3147: The ToggleToolbarDrawer command's skipFocus option has been deprecated. --- modules/ROOT/pages/8.0-release-notes.adoc | 34 ++++++++++++++++++- .../pages/editor-command-identifiers.adoc | 6 ++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/modules/ROOT/pages/8.0-release-notes.adoc b/modules/ROOT/pages/8.0-release-notes.adoc index 7c62f25b54..d3d4208cf5 100644 --- a/modules/ROOT/pages/8.0-release-notes.adoc +++ b/modules/ROOT/pages/8.0-release-notes.adoc @@ -1,4 +1,3 @@ - = {productname} {release-version} :release-version: 8.0.0 :navtitle: {productname} {release-version} @@ -104,6 +103,19 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a // CCFR here. +=== Added support for `skip_focus` option in ToggleToolbarDrawer command +// #TINY-12044 + +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. + +.Updated new `skip_focus` option usage command +[source] +---- +editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true }); +---- + +For more information on the `ToggleToolbarDrawer` command, see: xref:editor-command-identifiers.adoc[Available Commands]. + [[additions]] == Additions @@ -170,6 +182,26 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a // CCFR here. +=== The `ToggleToolbarDrawer` command's `skipFocus` option has been deprecated +// #TINY-12044 + +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. + +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. + +.Before deprecation using the `skipFocus` option +[source] +---- +editor.execCommand('ToggleToolbarDrawer', false, { skipFocus: true }); +---- + +.After deprecation using the `skip_focus` option +[source] +---- +editor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true }); +---- + +This change improves consistency across commands and aligns with expected usage patterns in {productname} {release-version}. [[known-issues]] == Known issues diff --git a/modules/ROOT/pages/editor-command-identifiers.adoc b/modules/ROOT/pages/editor-command-identifiers.adoc index c304ab5bb1..134b326630 100644 --- a/modules/ROOT/pages/editor-command-identifiers.adoc +++ b/modules/ROOT/pages/editor-command-identifiers.adoc @@ -155,7 +155,7 @@ The commands in the following table are provided by the {productname} editor and |mceTogglePlainTextPaste |Toggles paste as plain text. |mceToggleVisualAid |Toggles the visual aids for: tables without borders and anchors. |ToggleSidebar |Closes the current sidebar, or toggles the sidebar if the sidebar name is provided as a value (`__`). -|ToggleToolbarDrawer |Toggles the Toolbar Drawer. For information on toolbars, see: xref:toolbar-configuration-options.adoc#toolbar[User interface options - Toolbar]. +|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]. |=== .Examples @@ -199,7 +199,7 @@ tinymce.activeEditor.execCommand('mceTogglePlainTextPaste'); tinymce.activeEditor.execCommand('mceToggleVisualAid'); tinymce.activeEditor.execCommand('ToggleSidebar'); /* OR */ tinymce.activeEditor.execCommand('ToggleSidebar', false, ''); -tinymce.activeEditor.execCommand('ToggleToolbarDrawer'); +tinymce.activeEditor.execCommand('ToggleToolbarDrawer', false, null, { skip_focus: true }); ---- [[core-table-commands]] @@ -614,7 +614,7 @@ The following command states can be queried using the xref:apis/tinymce.editor.a |Strikethrough |Returns `+true+` if the content is formatted using the same markup as the {productname} `+Strikethrough+` command. |Subscript |Returns `+true+` if the content is formatted using the same markup as the {productname} `+Subscript+` command. |Superscript |Returns `+true+` if the content is formatted using the same markup as the {productname} `+Superscript+` command. -|ToggleToolbarDrawer |Returns `+true+` if the Toolbar Drawer is open. The state can be controlled by the {productname} `+ToggleToolbarDrawer+` command. +|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. |Underline |Returns `+true+` if the content is formatted using the same markup as the {productname} `+Underline+` command. |===