Skip to content

fix: prevent Watch Paths tooltip button from submitting the form#3977

Merged
Siumauricio merged 1 commit intoDokploy:canaryfrom
azizbecha:fix/watch-path-tooltip-submit
Mar 16, 2026
Merged

fix: prevent Watch Paths tooltip button from submitting the form#3977
Siumauricio merged 1 commit intoDokploy:canaryfrom
azizbecha:fix/watch-path-tooltip-submit

Conversation

@azizbecha
Copy link
Contributor

@azizbecha azizbecha commented Mar 12, 2026

What is this PR about?

The "Watch Paths" tooltip info button in the Git, Bitbucket, and Compose Git provider forms was unintentionally submitting the form when clicked. This happened because <TooltipTrigger> renders an internal <button> element, which defaults to type="submit" inside a <form>. The fix adds the asChild prop to <TooltipTrigger> and replaces the custom <div> with a <HelpCircle> icon, consistent with the GitHub, GitLab, and Gitea provider components where this already works correctly.

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related (if applicable)

closes #3976

Greptile Summary

This PR fixes a bug where the "Watch Paths" tooltip info button was unintentionally triggering form submission in the Git, Bitbucket, and Compose Git provider forms. The root cause was that Radix UI's <TooltipTrigger> renders a <button> element by default, which browsers treat as type="submit" when nested inside a <form>. By adding the asChild prop, <TooltipTrigger> delegates rendering to its child (<HelpCircle> — an SVG element), which carries no submit semantics.

The fix is minimal, correct, and directly mirrors the pattern already in use across the GitHub, GitLab, and Gitea provider components. No issues were found.

  • save-bitbucket-provider.tsx, save-git-provider.tsx, save-git-provider-compose.tsx: Added asChild to <TooltipTrigger> and replaced the hand-rolled <div>?</div> badge with the shared <HelpCircle> icon, aligning all six provider forms to the same pattern.
  • Visual styling is also improved — the HelpCircle icon with hover:text-foreground transition-colors matches the design used in the already-fixed providers.

Confidence Score: 5/5

  • This PR is safe to merge — it is a focused, low-risk bug fix with no logic changes beyond the tooltip trigger rendering.
  • The change is identical across all three files and exactly matches the established, working pattern from the GitHub/GitLab/Gitea providers already in the codebase. There are no side-effects, no new dependencies, and the fix directly addresses the described root cause (implicit button type="submit").
  • No files require special attention.

Last reviewed commit: 290267b

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@azizbecha azizbecha requested a review from Siumauricio as a code owner March 12, 2026 00:21
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 12, 2026
@dosubot dosubot bot added the bug Something isn't working label Mar 12, 2026
@Siumauricio Siumauricio merged commit c317ec3 into Dokploy:canary Mar 16, 2026
1 check passed
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:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watch Paths tooltip button submits form instead of showing info popover

2 participants