Skip to content

Issue 555: added ReactNode to toooltipcontent - #558

Open
Vilde Kristine Fossum (vildekfossum) wants to merge 2 commits into
mainfrom
555-støtte-for-formatert-text-i-tooltip

Hidden character warning

The head ref may contain hidden characters: "555-st\u00f8tte-for-formatert-text-i-tooltip"
Open

Vilde Kristine Fossum (vildekfossum) wants to merge 2 commits into
mainfrom
555-støtte-for-formatert-text-i-tooltip

Conversation

@vildekfossum

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

  • I have performed a self-review and test of my code
  • I have added label to the PR (major, minor or patch)
  • If applicable: Is story created/updated in stories-folder?
  • If applicable: Is README-file for CSS documentation created/updated?
  • If applicable: Are unit tests created/updated for the component?
  • If applicable: Tested in Storybook with keyboard, screen reader, zoom, and color contrast
  • If new component: Is tsx-file import added to packages/react/index.tsx?
  • If new component: Is CSS-file added to packages/css/index.css?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the MdTooltip component API to allow tooltipContent to be provided as React renderable content (not just plain strings), and aligns the Storybook documentation accordingly.

Changes:

  • Expanded MdTooltipProps.tooltipContent from string to support ReactNode.
  • Updated Storybook Tooltip argTypes to reflect the updated tooltipContent type.
  • Tightened Storybook children argTypes documentation to ReactNode.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
stories/Tooltip.stories.tsx Updates Storybook argTypes type summaries for tooltip props.
packages/react/src/tooltip/MdTooltip.tsx Expands tooltipContent prop typing to allow ReactNode.
Suppressed comments (1)

packages/react/src/tooltip/MdTooltip.tsx:10

  • This change expands the public API to accept arbitrary ReactNode for tooltipContent, but the existing tests only cover string content. Please add/extend a unit test to verify an element ReactNode (e.g. <span>…</span>) is rendered correctly inside the tooltip portal.
  tooltipContent: string | React.ReactNode;

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/react/src/tooltip/MdTooltip.tsx
Comment thread stories/Tooltip.stories.tsx
@@ -7,7 +7,7 @@ export interface MdTooltipProps extends React.HTMLAttributes<HTMLDivElement> {
/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fjern gammel kommentar / doc

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Støtte for formatert text i Tooltip

3 participants