reactjs-popup
reactjs-popup copied to clipboard
Enable controlled mode for tooltip
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:
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
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}>
×
</a>
</div>
)}
</Popup>
);