fix popover appearing off screen on initial open

Signed-off-by: Mark Dunphy <markd@spotify.com>
This commit is contained in:
Mark Dunphy
2025-03-27 10:41:54 -04:00
parent 50ce1645ab
commit c758f0fde7
@@ -145,6 +145,9 @@ export function EntityContextMenu(props: EntityContextMenuProps) {
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
transformOrigin={{ vertical: 'top', horizontal: 'right' }}
aria-labelledby="long-menu"
PaperProps={{
style: { minWidth: 200 },
}}
>
<MenuList autoFocusItem={Boolean(anchorEl)}>
{extraItems}
@@ -184,8 +187,11 @@ export function EntityContextMenu(props: EntityContextMenuProps) {
</MenuItem>
</>
) : (
contextMenuItems.map(ExtraMenuItem => (
<ExtraMenuItem onClose={onClose} />
contextMenuItems.map((ContextMenuItem, idx) => (
<ContextMenuItem
key={`context-menu-item-${idx}`}
onClose={onClose}
/>
))
)}
</MenuList>