Skip to content

Commit

Permalink
Fixed #1683 - Improve Tooltip implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Nov 23, 2020
1 parent d0a0dc2 commit cd399c9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import ConnectedOverlayScrollHandler from '../utils/ConnectedOverlayScrollHandle
export function tip(props) {
let appendTo = props.appendTo || document.body;

let tooltipWrapper = document.createElement('div');
let tooltipWrapper = document.createDocumentFragment();
DomHandler.appendChild(tooltipWrapper, appendTo);

props.appendTo = tooltipWrapper;
props = {...props, ...props.options};

let tooltipEl = React.createElement(Tooltip, props);
Expand All @@ -20,7 +19,6 @@ export function tip(props) {
return {
destroy: () => {
ReactDOM.unmountComponentAtNode(tooltipWrapper);
DomHandler.removeChild(tooltipWrapper, appendTo);
},
updateContent: (content) => {
ReactDOM.render(React.cloneElement(tooltipEl, {content}), tooltipWrapper);
Expand Down

0 comments on commit cd399c9

Please sign in to comment.