Skip to content

fix(tree): wrap static icon elements with tree-node-icon spacing class#8072

Open
ggdouglas wants to merge 1 commit intodevelopfrom
gd/tree-static-icon-styling
Open

fix(tree): wrap static icon elements with tree-node-icon spacing class#8072
ggdouglas wants to merge 1 commit intodevelopfrom
gd/tree-static-icon-styling

Conversation

@ggdouglas
Copy link
Copy Markdown
Contributor

@ggdouglas ggdouglas commented Apr 17, 2026

Summary

Tree nodes lost the bp6-tree-node-icon spacing class when icon was a JSX element, because <Icon> returns elements as-is. Wrap element icons in a <span class="bp6-tree-node-icon"> so their spacing matches string icons.

This was discovered during research on #8065

Code

import { Tree } from "@blueprintjs/core";

// dynamic
<Tree contents={[{ id: 0, icon: "folder-close", label: "Documents" }]} />
import { Tree } from "@blueprintjs/core";
import { FolderClose } from "@blueprintjs/icons";

// static
<Tree contents={[{ id: 0, icon: <FolderClose />, label: "Documents" }]} />

Screenshots

Before After
tree-before tree-after

Diff

tree-diff

@changelog-app
Copy link
Copy Markdown

changelog-app Bot commented Apr 17, 2026

Generate changelog in packages/core/changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

fix(tree): wrap static icon elements with tree-node-icon spacing class

Check the box to generate changelog(s)

  • Generate changelog entry

@changelog-app
Copy link
Copy Markdown

changelog-app Bot commented Apr 17, 2026

Successfully generated changelog entry!

Need to regenerate?

Simply interact with the changelog bot comment again to regenerate these entries.


📋Changelog Preview

💡 Improvements

  • fix(tree): wrap static icon elements with tree-node-icon spacing class (#8072)

@blueprint-previews
Copy link
Copy Markdown

fix(tree): wrap static icon elements with tree-node-icon spacing class

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant