Reactstrap: Uncontrolled Tooltip don't work inside Modal?

Created on 19 Feb 2018  路  1Comment  路  Source: reactstrap/reactstrap

  • components: Uncontrolled Tooltip
  • reactstrap version 5.0.0-alpha.4
  • react version 16.2.0
  • bootstrap version 4.0.0-beta

    Uncontrolled Tooltip don't work inside Modal?

>All comments

It seems to be working with the alpha release you are using: https://stackblitz.com/edit/reactstrap-v5beta-puwres?file=Example.js
Also in the current/latest beta release: https://stackblitz.com/edit/reactstrap-v5beta-pmvixf?file=Example.js

Code:

import React, { Component } from 'react';
import { Button, Modal, ModalBody, UncontrolledTooltip } from 'reactstrap';

class Example extends Component {
  state = {};
  toggle = () => {
    this.setState({ isOpen: !this.state.isOpen });
  }
  render() {
    return (
      <div>
        <Modal isOpen={this.state.isOpen} toggle={this.toggle}>
        <ModalBody>
          To get a tooltip, hover over this -> <span id="thing">thing</span>
          <UncontrolledTooltip target="thing">Junk and stuff</UncontrolledTooltip>
          </ModalBody>
        </Modal>
        <Button onClick={this.toggle}>Open Modal</Button>
      </div>
    )
  }
}

export default Example;

Preview:
uncontrolledtooltip-in-modal

Was this page helpful?
0 / 5 - 0 ratings