Fix SSO provider dialog closing when switching pill toggle tabs#1515
Conversation
The <button> elements in DesignPillToggle didn't have type="button", so they defaulted to type="submit" inside <form> elements. This caused the SSO provider settings dialog to close when switching from Custom back to Shared tab, because the pill toggle click submitted the form (and validation passed since shared providers don't require credentials). Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesPill Toggle Button Type
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryFixes a bug where clicking a
Confidence Score: 5/5Safe to merge — the single-line change is a well-established HTML correctness fix with no side effects. The entire diff is a one-line addition of type="button" to a button element. This is a correct fix for the described bug and cannot regress any other behavior; buttons with type="button" still fire onClick handlers normally, so the toggle logic and async loading state are unaffected. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant PillToggle as DesignPillToggle button
participant Form as SSO Settings Form
participant Dialog as Dialog Component
Note over User,Dialog: Before fix (button type defaults to "submit")
User->>PillToggle: Click "Custom" tab
PillToggle->>Form: Triggers form submit event
Form->>Dialog: Dialog closes (form submission detected)
Note over User,Dialog: After fix (type="button" explicit)
User->>PillToggle: Click "Custom" tab
PillToggle->>PillToggle: handleClick() fires, calls onSelect()
PillToggle-->>Dialog: No form submit event dispatched
Dialog-->>User: Dialog stays open, tab switches correctly
Reviews (1): Last reviewed commit: "Fix pill toggle buttons submitting forms..." | Re-trigger Greptile |
|
Actionable comments posted: 0 |
There was a problem hiding this comment.
No issues found across 1 file
Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more
Re-trigger cubic
Add
type="button"toDesignPillTogglebuttons to prevent them from submitting forms. Without this, buttons inside<form>default totype="submit", causing the SSO provider settings dialog to close when switching from Custom back to Shared tab.Link to Devin session: https://app.devin.ai/sessions/e479ec357e3843719b9b642327c25ab5
Requested by: @N2D4
Summary by cubic
Fixes the SSO provider settings dialog closing when switching between Custom and Shared tabs. Sets
type="button"onDesignPillTogglebuttons so clicks don't submit the surrounding form.Written for commit c7a040f. Summary will update on new commits.
Review in cubic
Summary by CodeRabbit