Skip to content

Commit

Permalink
disable flip property in popover components
Browse files Browse the repository at this point in the history
  • Loading branch information
phwebi committed Aug 23, 2019
1 parent e24677a commit 253c2c2
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 4 deletions.
14 changes: 13 additions & 1 deletion src/components/Popover.js
@@ -1,3 +1,4 @@
import React from 'react';
import PropTypes from 'prop-types';
import Popover from 'reactstrap/lib/Popover';

Expand All @@ -11,4 +12,15 @@ Popover.defaultProps = {
fade: false
};

export default Popover;
export default props => (
<Popover
{...props}
// This is a workaround for the reactstrap Tooltip memory leak issue.
// https://github.com/reactstrap/reactstrap/issues/1482#issuecomment-498747688
modifiers={{
flip: {
enabled: false,
},
}}
/>
);
13 changes: 12 additions & 1 deletion src/components/Tooltip.js
Expand Up @@ -26,7 +26,18 @@ export default class Tooltip extends React.Component {
const { isOpen, ...props } = this.props; // eslint-disable-line no-unused-vars

return (
<InnerTooltip isOpen={this.state.isOpen} toggle={this.toggle} {...props} />
<InnerTooltip
isOpen={this.state.isOpen}
toggle={this.toggle}
{...props}
// This is a workaround for the reactstrap Tooltip memory leak issue.
// https://github.com/reactstrap/reactstrap/issues/1482#issuecomment-498747688
modifiers={{
flip: {
enabled: false,
},
}}
/>
);
}
}
14 changes: 13 additions & 1 deletion src/components/UncontrolledPopover.js
@@ -1,3 +1,15 @@
import React from 'react';
import UncontrolledPopover from 'reactstrap/lib/UncontrolledPopover';

export default UncontrolledPopover;
export default props => (
<UncontrolledPopover
{...props}
// This is a workaround for the reactstrap Tooltip memory leak issue.
// https://github.com/reactstrap/reactstrap/issues/1482#issuecomment-498747688
modifiers={{
flip: {
enabled: false,
},
}}
/>
);
14 changes: 13 additions & 1 deletion src/components/UncontrolledTooltip.js
@@ -1,3 +1,15 @@
import React from 'react';
import UncontrolledTooltip from 'reactstrap/lib/UncontrolledTooltip';

export default UncontrolledTooltip;
export default props => (
<UncontrolledTooltip
{...props}
// This is a workaround for the reactstrap Tooltip memory leak issue.
// https://github.com/reactstrap/reactstrap/issues/1482#issuecomment-498747688
modifiers={{
flip: {
enabled: false,
},
}}
/>
);

0 comments on commit 253c2c2

Please sign in to comment.