Skip to content

Commit

Permalink
fix(table/column-setting): 挪 column-title_tooltip 至 Tree.titleRender 中
Browse files Browse the repository at this point in the history
  • Loading branch information
xlboy committed Jan 11, 2024
1 parent a18c9fb commit 8311638
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/table/src/components/ColumnSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,6 @@ const CheckboxList: React.FC<{
: config.disable?.checkbox,
isLeaf: parentConfig ? true : undefined,
};
if (item.title) {
const titleJsx = <>{item.title}</>
item.title = <Typography.Text style={{ width: 80 }} ellipsis={{ tooltip: titleJsx }}>{titleJsx}</Typography.Text>
}

if (children) {
item.children = loopData(children, {
Expand Down Expand Up @@ -265,12 +261,15 @@ const CheckboxList: React.FC<{
titleRender={(_node) => {
const node = { ..._node, children: undefined };
if (!node.title) return null;
const normalizedTitle = runFunction(node.title, node)
const wrappedTitle = <Typography.Text style={{ width: 80 }} ellipsis={{ tooltip: normalizedTitle }}>{normalizedTitle}</Typography.Text>

return (
<CheckboxListItem
className={className}
{...node}
showListItemOption={showListItemOption}
title={runFunction(node.title, node)}
title={wrappedTitle}
columnKey={node.key as string}
/>
);
Expand Down

0 comments on commit 8311638

Please sign in to comment.