Fixed context menu on index page (#9316)

Fixes https://github.com/twentyhq/twenty/issues/8970

The context menu wasn't working because of wrong architecture with the
Dropdown component, as it's a unique behavior (no clickable component
and portal) it also required refactoring a bit the Dropdown component.

- Context menu now uses a portal
- Fixed dropdown offset without clickable component (now using a
fallback anchor component)
- Fixed React array key props
This commit is contained in:
Lucas Bordeau
2025-01-03 11:11:33 +01:00
committed by GitHub
parent 0674388426
commit 8333892647
4 changed files with 63 additions and 56 deletions

View File

@ -10,8 +10,12 @@ type ArrayDisplayProps = {
export const ArrayDisplay = ({ value }: ArrayDisplayProps) => {
return (
<ExpandableList>
{value?.map((item) => (
<Chip variant={ChipVariant.Highlighted} label={item} />
{value?.map((item, index) => (
<Chip
key={`${item}-${index}`}
variant={ChipVariant.Highlighted}
label={item}
/>
))}
</ExpandableList>
);