Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-6286 add className prop #3297

Open
wants to merge 6 commits into
base: devel
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const NodeControl: NodeControlComponent = observer(
<TreeNodeControl ref={ref} style={{ height }}>
<TreeNodeExpand leaf={node.leaf} />
<TreeNodeIcon icon={node.icon} />
<TreeNodeName title={node.tooltip}>{node.name}</TreeNodeName>
<TreeNodeName title={node.tooltip ?? node.name}>{node.name}</TreeNodeName>
Copy link
Member

Choose a reason for hiding this comment

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

this we can keep

</TreeNodeControl>
);
}),
Expand Down
4 changes: 3 additions & 1 deletion webapp/packages/plugin-navigation-tree/src/TreeNew/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface NavigationTreeNewProps {
data: ITreeData;
nodeRenderers?: INodeRenderer[];
emptyPlaceholder?: NodeEmptyPlaceholderComponent;
className?: string;
onNodeClick?(id: string): void | Promise<void>;
onNodeDoubleClick?(id: string): void | Promise<void>;
getNodeDnDContext?(id: string, context: IDataContext): void;
Expand All @@ -37,6 +38,7 @@ export const Tree = observer<NavigationTreeNewProps>(function Tree({
data,
nodeRenderers,
emptyPlaceholder,
className,
onNodeClick,
onNodeDoubleClick,
getNodeDnDContext,
Expand All @@ -56,7 +58,7 @@ export const Tree = observer<NavigationTreeNewProps>(function Tree({
});

return (
<div ref={mountOptimization.setRootRef} style={{ overflow: 'auto', position: 'relative' }}>
<div ref={mountOptimization.setRootRef} className={className} style={{ overflow: 'auto', position: 'relative' }}>
<NodeSizeCacheContext.Provider value={elementsSizeCache}>
<TreeDataContext.Provider value={data}>
<TreeVirtualizationContext.Provider value={mountOptimization}>
Expand Down