Enter your suggestions in details:
If the label is passed a string, then both aria-label and the content rendered by the div will be plain strings. The special Markdown formatting within the div will not be rendered correctly. If the label is passed a JSX object, the div will render correctly, but the aria-label attribute will display [object Object].
|
export type HistoryChange = { |
|
versions: Array<string>; |
|
label: string; |
|
url?: string; |
|
}; |
|
|
|
type ChangeHistoryProps = ComponentProps<'div'> & { |
|
label: string; |
|
changes: Array<HistoryChange>; |
|
as?: LinkLike; |
|
}; |
|
<MenuItem |
|
key={change.label} |
|
className={styles.dropdownItem} |
|
role="menuitem" |
|
tabIndex={0} |
|
aria-label={`${change.label}: ${change.versions.join(', ')}`} |
|
href={change.url} |
|
> |
|
<div className={styles.dropdownLabel}>{change.label}</div> |
|
<div className={styles.dropdownVersions}> |
|
{change.versions.join(', ')} |
|
</div> |
|
</MenuItem> |
The doc-kit previously fixed the aria-label rendering issue using nodejs/doc-kit#1034. However, it wasn't completely resolved; currently, Markdown formatting is not rendered correctly within divs.

Enter your suggestions in details:
If the label is passed a string, then both
aria-labeland the content rendered by the div will be plain strings. The special Markdown formatting within the div will not be rendered correctly. If the label is passed a JSX object, the div will render correctly, but thearia-labelattribute will display[object Object].nodejs.org/packages/ui-components/src/Common/ChangeHistory/index.tsx
Lines 9 to 19 in 147063e
nodejs.org/packages/ui-components/src/Common/ChangeHistory/index.tsx
Lines 46 to 58 in 147063e
The doc-kit previously fixed the aria-label rendering issue using nodejs/doc-kit#1034. However, it wasn't completely resolved; currently, Markdown formatting is not rendered correctly within divs.