mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 19:49:59 +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,18 +18,14 @@ 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}
|
||||
title={inlineCollapsed && props.level === 1 ? props.children : ''}
|
||||
placement="right"
|
||||
overlayClassName={`${props.rootPrefixCls}-inline-collapsed-tooltip`}
|
||||
>
|
||||
{item}
|
||||
<Item {...props} ref={this.saveMenuItem} />
|
||||
</Tooltip>;
|
||||
}
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
export default MenuItem;
|
||||
|
Loading…
Reference in New Issue
Block a user