@@ -121,7 +121,7 @@ interface MenuLevelProps extends Omit<MenuProps, "children"> {
121121 parts ?: MenuPopoverParts ;
122122}
123123
124- function MenuLevel ( { items, open, phase, treeId, onClose, onBack, anchorRef, position, placement, menuRef : externalRef , autoFocusFirstItem, className, style, parts, ...props } : MenuLevelProps ) {
124+ function MenuLevel ( { items, open, phase, treeId, onClose, onBack, anchorRef, position, placement, menuRef : externalRef , autoFocusFirstItem, className, inlineSize , style, parts, ...props } : MenuLevelProps ) {
125125 const MenuSurface = parts ?. root ?? Menu ;
126126 const Item = parts ?. item ?? MenuItem ;
127127 const Separator = parts ?. separator ?? MenuSeparator ;
@@ -197,12 +197,12 @@ function MenuLevel({ items, open, phase, treeId, onClose, onBack, anchorRef, pos
197197 return ( ) => doc ?. removeEventListener ( "keydown" , keyboard , true ) ;
198198 } ) ;
199199
200- const submenu = activeEntry ? < SubmenuBoundary className = { styles . submenuBoundary } > < MenuLevel key = { activeEntry . id } id = { submenuId } aria-label = { activeEntry . label } menuRef = { submenuRef } items = { activeEntry . submenu ! } open = { open } phase = { phase } treeId = { treeId } onClose = { onClose } parts = { parts }
200+ const submenu = activeEntry ? < SubmenuBoundary className = { styles . submenuBoundary } > < MenuLevel key = { activeEntry . id } id = { submenuId } aria-label = { activeEntry . label } menuRef = { submenuRef } items = { activeEntry . submenu ! } open = { open } phase = { phase } treeId = { treeId } onClose = { onClose } parts = { parts } inlineSize = { inlineSize }
201201 onBack = { ( ) => { intent . closeNow ( ) ; submenuAnchor . current ?. focus ( ) ; } } anchorRef = { submenuAnchor } placement = "right" autoFocusFirstItem = { keyboardOpen . current }
202202 onPointerEnter = { intent . keepOpen } onPointerLeave = { intent . requestClose } /> </ SubmenuBoundary > : null ;
203203
204204 return < >
205- < MenuSurface { ...props } ref = { node => { ( menuRef as { current : HTMLDivElement | null } ) . current = node ; } } className = { classNames ( styles . popup , className ) } autoFocusFirstItem = { open && autoFocusFirstItem && Boolean ( layout ) } tabIndex = { - 1 }
205+ < MenuSurface { ...props } ref = { node => { ( menuRef as { current : HTMLDivElement | null } ) . current = node ; } } className = { classNames ( styles . popup , className ) } inlineSize = { inlineSize } autoFocusFirstItem = { open && autoFocusFirstItem && Boolean ( layout ) } tabIndex = { - 1 }
206206 style = { { ...layout ?. style , ...style , visibility : layout ? undefined : "hidden" } } data-openbitfun-native-webview-occlusion data-openbitfun-menu-tree = { treeId } data-placement = { layout ?. placement ?? placement } data-state = { phase }
207207 aria-hidden = { ! open || undefined } { ...( ! open ? { inert : "" } : { } ) } onContextMenu = { event => event . preventDefault ( ) } >
208208 { items . map ( item => item . separator ? < Separator key = { item . id } /> : < Item key = { item . id } data-menu-id = { item . id } leading = { item . icon ? < Leading className = { styles . icon } data-openbitfun-icon-slot = "true" > { item . icon } </ Leading > : undefined } shortcut = { item . shortcut ? < Shortcut > { item . shortcut } </ Shortcut > : undefined } tone = { item . tone } role = { item . role } checked = { item . checked }
0 commit comments