Skip to content

Conversation

@luwes
Copy link
Collaborator

@luwes luwes commented Nov 14, 2025

No description provided.

@luwes luwes requested a review from Copilot November 14, 2025 01:19
@luwes luwes self-assigned this Nov 14, 2025
@vercel
Copy link

vercel bot commented Nov 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
vjs-10-demo-html Ready Ready Preview Comment Nov 14, 2025 1:34am
vjs-10-demo-next Ready Ready Preview Comment Nov 14, 2025 1:34am
vjs-10-demo-react Ready Ready Preview Comment Nov 14, 2025 1:34am
vjs-10-website Ready Ready Preview Comment Nov 14, 2025 1:34am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the anchor name handling in Popover and Tooltip components by ensuring that auto-generated IDs are properly escaped for CSS selector usage. When no explicit ID is provided, the components now use CSS.escape() to sanitize the uniqueId before using it as popupId, preventing potential issues with special characters in CSS selectors.

Key Changes:

  • Applied CSS.escape() to auto-generated IDs in both Tooltip and Popover components to ensure valid CSS anchor names

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
packages/react/src/components/Tooltip.tsx Added CSS.escape() to sanitize auto-generated uniqueId for popupId
packages/react/src/components/Popover.tsx Added CSS.escape() to sanitize auto-generated uniqueId for popupId

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


const uniqueId = useId();
const popupId = id ?? uniqueId;
const popupId = id ?? uniqueId.replace(/^:([^:]+):$/g, '«$1»');
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The character transformation logic is duplicated across Tooltip and Popover components. Consider extracting this into a shared utility function (e.g., sanitizeId or formatAnchorId) to maintain consistency and make future updates easier.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants