mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
Revert "MenuItem: avoid rendering Tooltip unless necessary (#9636)"
This reverts commit 0754845aff
.
Conditional rendering will break the transition animation,
since React will create new DOM node when inlineCollapsed changges.
Fix https://github.com/react-component/menu/issues/139
This commit is contained in:
parent
b5a52d26f2
commit
56e3384c6b
@ -18,17 +18,13 @@ class MenuItem extends React.Component<any, any> {
|
||||
render() {
|
||||
const { inlineCollapsed } = this.context;
|
||||
const props = this.props;
|
||||
const item = <Item {...props} ref={this.saveMenuItem} />;
|
||||
if (inlineCollapsed && props.level === 1) {
|
||||
return <Tooltip
|
||||
title={props.children}
|
||||
placement="right"
|
||||
overlayClassName={`${props.rootPrefixCls}-inline-collapsed-tooltip`}
|
||||
>
|
||||
{item}
|
||||
</Tooltip>;
|
||||
}
|
||||
return item;
|
||||
return <Tooltip
|
||||
title={inlineCollapsed && props.level === 1 ? props.children : ''}
|
||||
placement="right"
|
||||
overlayClassName={`${props.rootPrefixCls}-inline-collapsed-tooltip`}
|
||||
>
|
||||
<Item {...props} ref={this.saveMenuItem} />
|
||||
</Tooltip>;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user