Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ const StatelessSelect = <T extends string>({
<div
className={classNames(styles.dropdown, { [styles.inline]: inline })}
>
{mappedValues.map(({ label: groupLabel, items }, groupKey) => (
{mappedValues.map(({ label: groupLabel, items }) => (
<div
key={groupLabel?.toString() ?? groupKey}
key={
groupLabel?.toString() ??
JSON.stringify(items.map(({ value }) => value))
}
className={styles.group}
>
{groupLabel && (
Expand Down
9 changes: 7 additions & 2 deletions packages/ui-components/src/Common/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ const Select = <T extends string>({
);

const memoizedMappedValues = useMemo(() => {
return mappedValues.map(({ label, items }, key) => (
<SelectPrimitive.Group key={label?.toString() ?? key}>
return mappedValues.map(({ label, items }) => (
<SelectPrimitive.Group
key={
label?.toString() ??
JSON.stringify(items.map(({ value }) => value))
}
>
{label && (
<SelectPrimitive.Label
className={classNames(styles.item, styles.label)}
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-components/src/Common/TableOfContents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const TableOfContents: FC<TableOfContentsProps> = ({
<ChevronRightIcon className={styles.icon} /> {summaryTitle}
</summary>
<ul className={styles.list}>
{filteredHeadings.map((head, index) => (
<li key={head.data?.id ?? index}>
{filteredHeadings.map(head => (
<li key={head.data?.id ?? `${head.depth}:${head.value}`}>
<Component
href={head.data?.id && `#${head.data.id}`}
className={classNames(styles.link, depthClasses[head.depth], {
Expand Down