Skip to content

Commit 516fb13

Browse files
committed
fix(editor): retain focus after choosing a format
1 parent 542fb1b commit 516fb13

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/menus

‎apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/menus/toolbar-menu.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export function ToolbarMenu({ editor, label, value, active, items }: ToolbarMenu
7272
<DropdownMenuContent
7373
align='start'
7474
className='w-[220px]'
75+
onCloseAutoFocus={(event) => {
76+
if (editor.isFocused) event.preventDefault()
77+
}}
7578
onKeyDown={(event) => event.stopPropagation()}
7679
>
7780
{items.map(({ label: itemLabel, icon: Icon, shortcut, active, disabled, onSelect }) => (

0 commit comments

Comments
 (0)