Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-tooltip functionality is not working for the Link component #2377

Open
anuradha9712 opened this issue Oct 8, 2024 · 1 comment
Open
Assignees
Labels
design system hacktoberfest https://hacktoberfest.digitalocean.com react typescript

Comments

@anuradha9712
Copy link
Collaborator

anuradha9712 commented Oct 8, 2024

Description

Auto-tooltip functionality is not working for the Link component.

In normal cases, Auto tooltip appears automatically on hover whenever its children shows overflow behavior (Refer to this). But currently, in Link component this behavior does not work properly.

image

Steps to reproduce

  • Go to storybook
  • Navigate to Link component
  • Paste the following example and verify the behavior
  const [showTooltip, setShowTooltip] = React.useState(false);
  const elementRef = React.useRef(null);
  return (
        <Tooltip
          showOnTruncation={true}
          elementRef={elementRef}
          tooltip="John Doe: Passionate Innovator and Visionary Leader"
        >
            <Link
                href="http://innovaccer.com/" 
                ref={elementRef} 
                onClick={function(){}} 
                target="_blank"  
                className="ellipsis--noWrap d-inline-block w-50"
             >
              John Doe: Innovator and Visionary Leader test
            </Link>
        </Tooltip>
  );
}

Expected result

  • Link should truncate in case of overflow
  • Tooltip should appear whenever user hover over the Link and should display full link content.

Steps to fix the issue

  • Fork and clone this repository
  • First checkout to develop branch, and from that create a new branch
  • Install dependencies using npm install
  • Start development server using npm run dev
  • Check the issue on your local environment on localhost:5000
  • Refer to Tooltip & Link component
@anuradha9712 anuradha9712 added hacktoberfest https://hacktoberfest.digitalocean.com design system react typescript labels Oct 8, 2024
@youngheart12
Copy link
Contributor

@anuradha9712 Please assign this to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design system hacktoberfest https://hacktoberfest.digitalocean.com react typescript
Projects
None yet
Development

No branches or pull requests

2 participants