fix: prevent preview controls from submitting forms - #530
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Walkthrough预览控件按钮新增 Changes预览控件按钮类型
Estimated code review effort: 1 (简单) | ~5 分钟 Merge Risk: ⚪ Minimal · up to The preview Close and Previous controls now cannot submit surrounding forms, while navigation and close behavior remains unchanged; no actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
Summary
type="button"Why
A native
<button>defaults totype="submit". When a preview portal is mounted into a form throughgetContainer(or another inline/custom container), clicking Close or Previous can therefore submit the surrounding form. These controls only operate the preview and should never submit form data.Verification
typegit diff --check: passedAI assistance disclosure: Codex assisted with repository screening, duplicate/changed-file checks, test execution, and drafting. I verified the behavior, patch, and results.
Summary by CodeRabbit