Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/eui/changelogs/upcoming/8864.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Fixed support for `css` key in items object passed to `EuiTreeView`
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const Playground: Story = {
label: "I'm a Bug",
id: 'item_bug',
icon: <EuiToken iconType="tokenEnum" />,
css: ({ euiTheme }) => `color: ${euiTheme.colors.textDanger}`,
},
],
},
Expand Down
4 changes: 4 additions & 0 deletions packages/eui/src/components/tree_view/tree_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export interface Node {
/** Optional class to throw on the node
*/
className?: string;
/** Optional styles
*/
css?: CommonProps['css'];
/** Function to call when the item is clicked.
The open state of the item will always be toggled.
*/
Expand Down Expand Up @@ -327,6 +330,7 @@ export class EuiTreeViewClass extends Component<
key={buttonId + index}
id={buttonId}
className={node.className}
css={node.css}
buttonRef={(ref) => this.setButtonRef(ref, index)}
aria-controls={node.children ? wrappingId : undefined}
label={node.label}
Expand Down