fix: prevent command menu from closing when clicking items in slash menu (#12555)
resolve #12540 Prevent command menu from closing by adding new excludedClickOutsideIds constant. https://github.com/user-attachments/assets/965075d5-d592-4d50-bb5a-1b2bb561e55a --------- Co-authored-by: Raphaël Bosi <71827178+bosiraphael@users.noreply.github.com>
This commit is contained in:
@ -0,0 +1,2 @@
|
||||
export const SLASH_MENU_DROPDOWN_CLICK_OUTSIDE_ID =
|
||||
'slash-menu-dropdown-click-outside-id';
|
||||
@ -1,6 +1,7 @@
|
||||
import type { SuggestionMenuProps } from '@blocknote/react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { SLASH_MENU_DROPDOWN_CLICK_OUTSIDE_ID } from '@/ui/input/constants/SlashMenuDropdownClickOutsideId';
|
||||
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
|
||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||
import { OverlayContainer } from '@/ui/layout/overlay/components/OverlayContainer';
|
||||
@ -44,7 +45,11 @@ export const CustomSlashMenu = (props: CustomSlashMenuProps) => {
|
||||
animate={{ opacity: 1 }}
|
||||
transition={{ duration: 0.1 }}
|
||||
>
|
||||
<OverlayContainer ref={refs.setFloating} style={floatingStyles}>
|
||||
<OverlayContainer
|
||||
ref={refs.setFloating}
|
||||
style={floatingStyles}
|
||||
data-click-outside-id={SLASH_MENU_DROPDOWN_CLICK_OUTSIDE_ID}
|
||||
>
|
||||
<StyledInnerContainer>
|
||||
<DropdownContent>
|
||||
<DropdownMenuItemsContainer>
|
||||
|
||||
Reference in New Issue
Block a user