Skip to content

Commit

Permalink
Refactor #1880 - For Tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Mar 17, 2021
1 parent 76e98da commit bf16a7b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import { classNames } from '../utils/ClassNames';
import DomHandler from '../utils/DomHandler';
import ConnectedOverlayScrollHandler from '../utils/ConnectedOverlayScrollHandler';
import { Portal } from '../portal/Portal';

export function tip(props) {
let appendTo = props.appendTo || document.body;
Expand Down Expand Up @@ -101,8 +102,6 @@ export class Tooltip extends Component {
position: this.props.position
};

this.appendTo = this.props.appendTo || document.body;

this.show = this.show.bind(this);
this.hide = this.hide.bind(this);
}
Expand Down Expand Up @@ -466,7 +465,7 @@ export class Tooltip extends Component {
if (this.state.visible) {
const element = this.renderElement();

return ReactDOM.createPortal(element, this.appendTo);
return <Portal element={element} appendTo={this.props.appendTo} visible />;
}

return null;
Expand Down

0 comments on commit bf16a7b

Please sign in to comment.