Skip to content

fix(ui): allow removing watch paths (delete icon click blocked by badge pointer-events)#4785

Closed
fredhii wants to merge 1 commit into
Dokploy:canaryfrom
fredhii:fix/watchpath-badge-delete-pointer-events
Closed

fix(ui): allow removing watch paths (delete icon click blocked by badge pointer-events)#4785
fredhii wants to merge 1 commit into
Dokploy:canaryfrom
fredhii:fix/watchpath-badge-delete-pointer-events

Conversation

@fredhii

@fredhii fredhii commented Jul 9, 2026

Copy link
Copy Markdown

Closes #4780

Problem

Watch path badges cannot be removed. Clicking the X on a watch-path badge does nothing, so a mistyped path is stuck.

Root cause

The shadcn Badge base classes (components/ui/badge.tsx) include [&>svg]:pointer-events-none. In the Watch Paths field the lucide X delete icon is rendered as a direct child of <Badge>, so it inherits pointer-events: none and its onClick never fires. This regressed with the Tailwind v4 / shadcn Badge update — the utility is intended for decorative icons, but here the icon is interactive.

Adding pointer-events-auto on the icon does not help: the [&>svg] parent selector has higher specificity than a standalone utility.

Fix

Wrap the X icon in a real <button type="button"> and move the onClick there. The svg is no longer a direct child of Badge, so [&>svg]:pointer-events-none no longer matches, and click handling is restored. Bonus: the control is now keyboard-focusable with an explicit aria-label, and type="button" prevents accidental form submits.

No changes to the shared Badge component (other decorative-icon badges keep their intended behavior).

Scope

Applied to every git provider form that renders watch-path badges, for both application and compose:

  • github / gitlab / gitea / bitbucket / generic git (application)
  • github / gitlab / gitea / bitbucket / generic git (compose)

Testing

  • biome check passes clean on all 10 touched files.
  • Manually verified the delete X now removes the badge in the Watch Paths field.

@fredhii fredhii requested a review from Siumauricio as a code owner July 9, 2026 14:44
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jul 9, 2026
The shadcn Badge base styles include [&>svg]:pointer-events-none, which
disabled pointer events on the lucide X icon rendered as a direct child
of Badge in the Watch Paths field. As a result the delete onClick never
fired and users could not remove a watch path.

Wrap the X icon in a real <button type="button"> so the svg is no longer
a direct child of Badge, restoring click handling and improving
accessibility (keyboard focusable, explicit aria-label).

Applies to all git provider forms (github/gitlab/gitea/bitbucket/git)
for both application and compose.

Closes #4780
@fredhii fredhii force-pushed the fix/watchpath-badge-delete-pointer-events branch from 8dfad46 to 1ac0f40 Compare July 9, 2026 14:48
@fredhii

fredhii commented Jul 9, 2026

Copy link
Copy Markdown
Author

Closing as a duplicate of #4782, which was opened first and is already under review. I left the accessibility suggestions there so they land on the PR that merges.

@fredhii fredhii closed this Jul 9, 2026
@fredhii fredhii deleted the fix/watchpath-badge-delete-pointer-events branch July 9, 2026 14:53
@imrja8

imrja8 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Done! I've incorporated your accessibility suggestions into my PR (#4782) and perfectly aligned the class structures.

I've also added you as a co-author on the commit to give you credit.
Thanks for the catch! 🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to delete a watchpath

2 participants