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

[Bug]: Tag components use query selector with id value without protection #16570

Closed
2 tasks done
Kilian-Collender opened this issue May 24, 2024 · 0 comments · Fixed by #16571
Closed
2 tasks done

[Bug]: Tag components use query selector with id value without protection #16570

Kilian-Collender opened this issue May 24, 2024 · 0 comments · Fixed by #16571
Assignees
Labels

Comments

@Kilian-Collender
Copy link
Contributor

Package

@carbon/react

Browser

Chrome

Package version

v1.58.0

React version

v18.2.0

Description

The following PR #16437 introduces the use of a querySelector call in the tag components which uses the id directly. If the id value contains anything that isn't a valid query then it breaks. It should use a ref to access the instance of the Tag DOM node.

Also the helper function isEllipsisActive accesses a element prop directly without validation and this causes an error if the element isn't a valid DOM node.

Reproduction/example

https://stackblitz.com/edit/github-ejg4ae?file=src%2FApp.jsx

Steps to reproduce

open browser console and see errors

Suggested Severity

Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants