From b2281141f825ae614dbeeb3545e21f0554fc2ebe Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Wed, 23 Apr 2025 22:45:02 +0530 Subject: [PATCH] fix: Always show "note from selection" option in toolbar to prevent layout shift on smaller widths (skip e2e) --- .../Plugins/ToolbarPlugin/ToolbarPlugin.tsx | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/packages/web/src/javascripts/Components/SuperEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx b/packages/web/src/javascripts/Components/SuperEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx index c66a49bb0..a2fb5672a 100644 --- a/packages/web/src/javascripts/Components/SuperEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx +++ b/packages/web/src/javascripts/Components/SuperEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx @@ -801,23 +801,22 @@ const ToolbarPlugin = () => { )} - {hasNonCollapsedSelection && ( - -
Create new note from selection
-
- Creates a new note containing the current selection and replaces the selection with a link to the - new note. -
- - } - iconName="notes" - onSelect={() => { - editor.dispatchCommand(CREATE_NOTE_FROM_SELECTION_COMMAND, undefined) - }} - /> - )} + +
Create new note from selection
+
+ Creates a new note containing the current selection and replaces the selection with a link to the + new note. +
+ + } + iconName="notes" + onSelect={() => { + editor.dispatchCommand(CREATE_NOTE_FROM_SELECTION_COMMAND, undefined) + }} + disabled={!hasNonCollapsedSelection} + /> {isMobile && (