fix(ui): make interactive icons inside badges clickable again#4827
Open
Siumauricio wants to merge 1 commit into
Open
fix(ui): make interactive icons inside badges clickable again#4827Siumauricio wants to merge 1 commit into
Siumauricio wants to merge 1 commit into
Conversation
The Tailwind v4 / shadcn badge update added [&>svg]:pointer-events-none to the badge base class, which swallowed clicks on the X remove icons rendered inside badges (watch paths in every git provider form), so watch paths could no longer be deleted. Scope the rule to non-interactive icons so svgs marked cursor-pointer receive clicks. Fixes #4780
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the Tailwind v4 / shadcn update (#4706), the badge base class includes
[&>svg]:pointer-events-none. The watch-path badges render their removeX(lucide) as a direct svg child ofBadge, so the icon'sonClicknever fired — watch paths could not be deleted in any of the git provider forms (application and compose variants). The remove handlers themselves are correct; the click just never reached them. Note that a plainpointer-events-autoon the icons would lose to the badge rule on specificity, which is why the rule itself is scoped.Scope the badge rule to non-interactive icons:
[&>svg:not(.cursor-pointer)]:pointer-events-none. All the removable-badge icons already carrycursor-pointer, so they become clickable again, while decorative badge icons keep passing events through. Verified the generated CSS with the project's Tailwind build.Fixes #4780