diff --git a/frontend/app/element/dropdown.stories.tsx b/frontend/app/element/dropdown.stories.tsx index 34385ef3..456685c0 100644 --- a/frontend/app/element/dropdown.stories.tsx +++ b/frontend/app/element/dropdown.stories.tsx @@ -99,6 +99,23 @@ export const Test: Story = { }, ], }, + { + label: "Option 4", + onClick: () => console.log("Clicked Option 3"), + subItems: [ + { label: "Option 4 -> 1", onClick: () => null }, + { label: "Option 4 -> 2", onClick: () => null }, + { label: "Option 4 -> 4", onClick: () => null }, + { label: "Option 4 -> 4", onClick: () => null }, + { label: "Option 4 -> 5", onClick: () => null }, + { label: "Option 4 -> 6", onClick: () => null }, + { label: "Option 4 -> 7", onClick: () => null }, + { label: "Option 4 -> 8", onClick: () => null }, + { label: "Option 4 -> 9", onClick: () => null }, + { label: "Option 4 -> 10", onClick: () => null }, + { label: "Option 4 -> 11", onClick: () => null }, + ], + }, ], }, }; diff --git a/frontend/app/element/dropdown.tsx b/frontend/app/element/dropdown.tsx index be743db3..469b2d20 100644 --- a/frontend/app/element/dropdown.tsx +++ b/frontend/app/element/dropdown.tsx @@ -31,16 +31,20 @@ const SubMenu = memo( } }); + // Check if the position for the submenu is calculated + const position = subMenuPosition[parentKey]; + const isPositioned = position && position.top !== undefined && position.left !== undefined; + const subMenu = (