From 37cb968a223b6e12f2d0a4a0fcc39bcb40ab0948 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Fri, 22 Sep 2023 13:42:10 +0400 Subject: [PATCH] Editor: Always render the 'Switch to Draft' button to avoid focus loss --- .../components/post-switch-to-draft-button/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/editor/src/components/post-switch-to-draft-button/index.js b/packages/editor/src/components/post-switch-to-draft-button/index.js index 37c413130e0259..590d7722b82299 100644 --- a/packages/editor/src/components/post-switch-to-draft-button/index.js +++ b/packages/editor/src/components/post-switch-to-draft-button/index.js @@ -28,9 +28,7 @@ export default function PostSwitchToDraftButton() { }; }, [] ); - if ( ! isPublished && ! isScheduled ) { - return null; - } + const isDisabled = isSaving || ( ! isPublished && ! isScheduled ); let alertMessage; if ( isPublished ) { @@ -50,9 +48,11 @@ export default function PostSwitchToDraftButton() {