Skip to content

Can the ChangeHistory component adjust the label rendering logic or the passed value? #9114

Closed

Description

@btea

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.

Image

Activity

  1. btea commented on Aug 22, 2026

    @btea
    ContributorAuthor

    It seems that #9115 has solved the problem. cc @avivkeller

  2. AugustinMauroy commented on Aug 22, 2026

    @AugustinMauroy
    Member

    it's accept react value now but need to transform first nodejs/doc-kit#1049

  3. btea commented on Aug 22, 2026

    @btea
    ContributorAuthor

    I noticed that too. Good job. 👍

  4. avivkeller commented on Aug 22, 2026

    @avivkeller
    Member

    Yep! Great minds think alike :-) this is on my list of things to do. After changing the component to accept a node I'll fix the remaining parts in doc kit

  5. moved this from 📋 Backlog to ✅ Done in Node.js Websiteon Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions