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

fix: remove duplicate TooltipProvider wrapping #6759

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juliusliu02
Copy link

Remove duplicated TooltipProvider and change delayDuration to API default value.

Remove duplicated TooltipProvider and change delayDuration to API default value.
Copy link

vercel bot commented Feb 24, 2025

@juliusliu02 is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@juliusliu02 juliusliu02 changed the title Fix TooltipProvider structure fix: Fix TooltipProvider structure Feb 25, 2025
@juliusliu02 juliusliu02 changed the title fix: Fix TooltipProvider structure fix: fix TooltipProvider structure Feb 25, 2025
@juliusliu02 juliusliu02 changed the title fix: fix TooltipProvider structure fix: remove duplicate TooltipProvider wrapping Feb 25, 2025
@shadcn
Copy link
Collaborator

shadcn commented Feb 27, 2025

hmm the <TooltipProvider /> is expected to wrap the <Tooltip />. Not sure what the proposed changes are. Can you elaborate?

@shadcn shadcn added component: tooltip postpone: more info or changes requested maintainers asked a question or needs more info labels Feb 27, 2025
@juliusliu02
Copy link
Author

juliusliu02 commented Feb 27, 2025

According to the example on the website, Tooltip should be wrapped within the TooltipProvider in the actual component that uses a tooltip:

export function TooltipDemo() {
  return (
    <TooltipProvider>
      <Tooltip>
        <TooltipTrigger asChild>
          <Button variant="outline">Hover</Button>
        </TooltipTrigger>
        <TooltipContent>
          <p>Add to library</p>
        </TooltipContent>
      </Tooltip>
    </TooltipProvider>
  )
}

Wrapping it again here in the current code will result in two layers of wrapping, and delayDuration always getting overridden by its default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tooltip postpone: more info or changes requested maintainers asked a question or needs more info
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants