Skip to content

[BUG] Tooltip closes when button click changes conditional state variable #1111

@thomas-hogan

Description

@thomas-hogan

Bug description
When the tooltip contains a button that updates a state variable, and that same variable is used to show the button, the tooltip crashes/closes. Works properly if the button remains in the tooltip or the hide functionality is done with CSS instead.

Version of Package
v5.21.7

To Reproduce
https://codesandbox.io/s/strange-einstein-66wc93?file=/src/TestComponent.jsx

Expected behavior
Ideally there is some functionality where the tooltip contains option buttons and when one is clicked it hides those buttons and displays some other content.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information if possible or delete this section):

  • OS: macOS
  • Browser Chrome
  • Version 118.0.5993.117
  • Frameworks React 18, Next.js 13

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions