Skip to content

[BUG] imperativeModeOnly not working as expected #1226

Closed
@gabrieljablonski

Description

@gabrieljablonski

Discussed in #1225

Originally posted by GabrielMAraujo September 6, 2024
Hi,

I've been trying to do a custom implementation of the tooltip that requires me to open and close the tooltip programmatically, and it also must not close the tooltip when the mouse hovers out the anchor div.

I read in the docs that the imperativeModeOnly prop should suffice in this case, but I tried to use it and it seems like it's not working.

I made an example in CodeSandbox that shows this behavior (it should open the tooltip and never close it): https://codesandbox.io/p/sandbox/tooltip-forked-gf82hl
Am I doing something wrong, or is this a bug?


Seems to be a bug with the imperativeModeOnly prop.

For now, manually clearing the events objects seems to work.

<Tooltip
  content="Hello world!"
  imperativeModeOnly={true}
  openEvents={{}}
  closeEvents={{}}
  globalCloseEvents={{}}
  ref={tooltipRef}
/>

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