Skip to content

[Bug] Mind map labels are truncated to one line with ellipsis #457

Open

Description

@zmxccxy

Description

Mind map node labels longer than the renderer's 160px text width are always truncated to one line with an ellipsis, even when the label could wrap onto multiple lines.

The SSR mind map renderer hard-codes:

labelTextOverflow: 'ellipsis',
labelWordWrap: true,
labelMaxLines: 1,

and the node height / layout height are fixed (32/36 and 30), so simply allowing more lines would overflow the node.

Expected

Long labels wrap onto multiple lines, the node height grows with the line count, and the mind map layout uses the actual node height. No ellipsis is rendered.

Actual

Long labels are truncated to one line with ....

Reproduction

Render any mind map with a long node label, for example:

await render({
  type: 'mind-map',
  width: 600,
  height: 400,
  data: {
    name: 'Project plan',
    children: [{ name: 'A very long node label that should wrap onto several lines' }],
  },
});

Screenshots

Before After
before after

A PR with the fix and updated tests follows.

Activity

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions