Skip to content
Discussion options

You must be logged in to vote

Hello 👋,

I've just ran into the same issue, and came up with something, but I'm not sure it's the best solution 🤔:

function Component() {
  const isNextOpenPrevented = useRef(false);

  return (
    <Popover.Root modal>
      <Tooltip.Root>
        <Popover.Trigger asChild>
          <Tooltip.Trigger
            onFocus={(event) => {
              if (isNextOpenPrevented.current) {
                isNextOpenPrevented.current = false;
                event.preventDefault();
              }
            }}
          >
            Open
          </Tooltip.Trigger>
        </Popover.Trigger>

        <Tooltip.Content>Content</Tooltip.Content>
      </Tooltip.Root>

      <Popover.Portal>
        

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@simonrelet
Comment options

Answer selected by georgecponta
@georgecponta
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants