mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
@@ -33,6 +33,12 @@ type Props = {
|
|||||||
align?: "start" | "end";
|
align?: "start" | "end";
|
||||||
/** ARIA label for the menu */
|
/** ARIA label for the menu */
|
||||||
ariaLabel: string;
|
ariaLabel: string;
|
||||||
|
/**
|
||||||
|
* Whether the menu should lock page scroll and trap focus while open.
|
||||||
|
* Defaults to true. Set to false to avoid the scrollbar-removal layout
|
||||||
|
* shift when the menu lives inside a scrollable container.
|
||||||
|
*/
|
||||||
|
modal?: boolean;
|
||||||
/** Additional component to display at the bottom of the top-level menu */
|
/** Additional component to display at the bottom of the top-level menu */
|
||||||
append?: React.ReactNode;
|
append?: React.ReactNode;
|
||||||
/** Callback when menu is opened */
|
/** Callback when menu is opened */
|
||||||
@@ -50,6 +56,7 @@ export const DropdownMenu = observer(
|
|||||||
children,
|
children,
|
||||||
align = "start",
|
align = "start",
|
||||||
ariaLabel,
|
ariaLabel,
|
||||||
|
modal = true,
|
||||||
append,
|
append,
|
||||||
onOpen,
|
onOpen,
|
||||||
onClose,
|
onClose,
|
||||||
@@ -116,7 +123,7 @@ export const DropdownMenu = observer(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<MenuProvider variant="dropdown">
|
<MenuProvider variant="dropdown">
|
||||||
<Menu open={open} onOpenChange={handleOpenChange}>
|
<Menu open={open} onOpenChange={handleOpenChange} modal={modal}>
|
||||||
<MenuTrigger ref={ref} aria-label={ariaLabel} {...rest}>
|
<MenuTrigger ref={ref} aria-label={ariaLabel} {...rest}>
|
||||||
{children}
|
{children}
|
||||||
</MenuTrigger>
|
</MenuTrigger>
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ function CommentMenu({
|
|||||||
action={rootAction}
|
action={rootAction}
|
||||||
align="end"
|
align="end"
|
||||||
ariaLabel={t("Comment options")}
|
ariaLabel={t("Comment options")}
|
||||||
|
modal={false}
|
||||||
>
|
>
|
||||||
<OverflowMenuButton className={className} />
|
<OverflowMenuButton className={className} />
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
|
|||||||
Reference in New Issue
Block a user