From fc82d2f6d5e8a93f0e7ce4861c5205c8a4b49c30 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 8 Oct 2024 20:00:49 +0300 Subject: Move Dialogs to Radix (#5648) * Use Redix FocusTrap (#5638) * Use Redix FocusTrap * force resolutions on radix libs * add focus guards * use @radix-ui/dismissable-layer for escape handling * fix banner menu keypress by using `Pressable` * add menu in dialog example to storybook --------- Co-authored-by: Samuel Newman * use DismissableLayer/FocusScope for composer * fix storybook dialog * thread Portal through Prompt and avatar/banner * fix dialog style regression * remove tamagui --------- Co-authored-by: Eric Bailey --- src/components/Menu/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/components/Menu/index.tsx') diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx index a22f43cf8..12cf1866e 100644 --- a/src/components/Menu/index.tsx +++ b/src/components/Menu/index.tsx @@ -18,6 +18,7 @@ import { ItemTextProps, TriggerProps, } from '#/components/Menu/types' +import {PortalComponent} from '#/components/Portal' import {Text} from '#/components/Typography' export { @@ -77,9 +78,11 @@ export function Trigger({children, label}: TriggerProps) { export function Outer({ children, showCancel, + Portal, }: React.PropsWithChildren<{ showCancel?: boolean style?: StyleProp + Portal?: PortalComponent }>) { const context = React.useContext(Context) const {_} = useLingui() @@ -87,15 +90,15 @@ export function Outer({ return ( + nativeOptions={{preventExpansion: true}} + Portal={Portal}> {/* Re-wrap with context since Dialogs are portal-ed to root */} - + {children} {isNative && showCancel && } - -- cgit 1.4.1