Browse Source

fix onVisible again (#2134)

pull/2146/head
afc163 9 years ago
parent
commit
151dc957a8
  1. 2
      components/tooltip/demo/basic.md
  2. 4
      components/tooltip/index.jsx

2
components/tooltip/demo/basic.md

@ -9,7 +9,7 @@ title: 基本
import { Tooltip } from 'antd';
ReactDOM.render(
<Tooltip title="提示文字" onVisibleChange={visible => console.log(visible)}>
<Tooltip title="提示文字">
<span>鼠标移上来就会出现提示</span>
</Tooltip>
, mountNode);

4
components/tooltip/index.jsx

@ -78,14 +78,14 @@ export default class Tooltip extends React.Component {
? `${children.props.className} ${openClassName}` : openClassName;
return (
<RcTooltip
{...this.props}
transitionName={transitionName}
builtinPlacements={placements}
overlay={title}
visible={visible}
onVisibleChange={this.onVisibleChange}
onPopupAlign={this.onPopupAlign}
ref="tooltip"
{...this.props}
onVisibleChange={this.onVisibleChange}
>
{visible ? cloneElement(children, { className: childrenCls }) : children}
</RcTooltip>

Loading…
Cancel
Save