reactjs-popup icon indicating copy to clipboard operation
reactjs-popup copied to clipboard

Enable controlled mode for tooltip

Open codereal-lucasvschenatto opened this issue 4 years ago • 2 comments

In my use case I need to have a controlled tooltip, to use a button inside the tooltip that closes it. I'm using the tooltip with a color picker inside and a button to remove the color but when I remove the color, the tooltip should be closed as well.

See screenshot: Screenshot from 2020-11-09 07-54-52

I have the exact same issue, I need a button inside my tooltip that can trigger a close :( did you ever find a way around this? @codereal-lucasvschenatto

bibschan avatar Aug 27 '21 20:08 bibschan

import React from "react";
import Popup from "reactjs-popup";

export default () => (
  <Popup trigger={<button>Trigger</button>} position="top left">
    {close => (
      <div>
        Content here
        <a className="close" onClick={close}>
          &times;
        </a>
      </div>
    )}
  </Popup>
);

pasharudenko avatar Dec 28 '22 18:12 pasharudenko