Skip to content

Commit

Permalink
Merge pull request #560 from Tencent/fix/cascader/ellipsis
Browse files Browse the repository at this point in the history
fix: cascader ellipisis tooltip
  • Loading branch information
chaishi authored Mar 16, 2022
2 parents d9caf1f + d3af7d0 commit 65c632e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/cascader/components/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export default mixins(keepAnimationMixins).extend({
name,

directives: { ripple },

components: {
Tooltip,
},
props: {
node: {
type: Object as PropType<CascaderItemPropsType['node']>,
Expand Down Expand Up @@ -107,21 +109,19 @@ export default mixins(keepAnimationMixins).extend({
function RenderLabelContent(node: TreeNode, cascaderContext: CascaderContextType) {
const label = RenderLabelInner(node, cascaderContext);
const isEllipsis = getLabelIsEllipsis(node, cascaderContext.size);
if (isEllipsis) {
return (
<span class={`${ComponentClassName}-label`} role="label">
{label}
<div class={`${ComponentClassName}-label--ellipsis`}>
<Tooltip content={node.label} placement="top-left" />
</div>
</span>
);
}
return (
const labelNode = (
<span class={[`${ComponentClassName}-label`]} role="label">
{label}
</span>
);
if (isEllipsis) {
return (
<Tooltip content={node.label} placement="top-left">
{labelNode}
</Tooltip>
);
}
return labelNode;
}

function RenderCheckBox(
Expand Down

0 comments on commit 65c632e

Please sign in to comment.