Skip to content

Commit

Permalink
Merge remote-tracking branch 'remote/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
duenyang committed Sep 25, 2024
2 parents d3cef46 + c138fc7 commit ffbd4b1
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions src/menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ export default class MenuItem extends Component<MenuItemProps> {
position: absolute;
inset: 0;
}
.${getClassPrefix()}-menu__item .${getClassPrefix()}-menu__item-tooltip-inner {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
`;

static propTypes = {
Expand Down Expand Up @@ -108,14 +100,15 @@ export default class MenuItem extends Component<MenuItemProps> {
</>
);

if (this.injection.collapsed.value && !this.props.disabled) {
return (
<t-tooltip content={label} placement="right">
<div className={`${classPrefix}-menu__item-tooltip-inner`}>{content}</div>
</t-tooltip>
);
}

return <div className={`${classPrefix}-menu__item--inner`}>{content}</div>;
return (
<>
<div className={`${classPrefix}-menu__item--inner`}>{content}</div>
{this.injection.collapsed.value && !this.props.disabled ? (
<t-tooltip content={label} placement="right">
<div style={{ position: 'absolute', inset: 0 }} />
</t-tooltip>
) : null}
</>
);
}
}

0 comments on commit ffbd4b1

Please sign in to comment.