- 
                Notifications
    
You must be signed in to change notification settings  - Fork 70
 
Closed
Labels
🐛 bugSomething isn't workingSomething isn't working
Description
Describe the bug
When children-components for the <Tooltip>-component has ref, the tooltip is not shown. I saw this issue #4006 , and it is marked as solved, but is it really solved?
When focusing the children with the ref, the tooltip is shown, but it is misplaced.
Steps to reproduce the bug
import { Button, Tooltip } from '@equinor/eds-core-react';
import { useRef } from 'react';
import styled from 'styled-components';
import packageJson from '../../package.json';
const Center = styled.div`
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    justify-content: center;
    height: 100vh;
`;
export function TooltipPage() {
  const buttonRef1 = useRef<HTMLButtonElement>(null);
  const buttonRef2 = useRef<HTMLButtonElement>(null);
  return (
    <Center>
      <Tooltip title="Lorem ipsum">
        <Button>Button (children without ref)</Button>
      </Tooltip>
      <Tooltip title="Lorem ipsum">
        <Button ref={buttonRef1}>Button (children with ref)</Button>
      </Tooltip>
      <Tooltip title="Lorem ipsum">
        <div>
          <Button ref={buttonRef2}>
            Button (children with ref, children wrapped in div)
          </Button>
        </div>
      </Tooltip>
      <div>
        react version: {packageJson.dependencies.react}
        <br />
        react-dom version: {packageJson.dependencies['react-dom']}
        <br />
        @equinor/eds-core-react version:{' '}
        {packageJson.dependencies['@equinor/eds-core-react']}
      </div>
    </Center>
  );
}Focus button that has a ref, tooltip is misplaced:

Expected behavior
Tooltip should be rendered even though children has ref.
Specifications
- @equinor/eds-core-react version: 1.0.1
 - react version: 19.2.0
 - Browser: Firefox version 144
 - OS: macOS Tahoe
 
pomfrida
Metadata
Metadata
Assignees
Labels
🐛 bugSomething isn't workingSomething isn't working

