fix: remove button semantics when click upload is disabled - #728
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 (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough当 Changes上传控件可访问性属性
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This change removes misleading button semantics and keyboard focus when click-to-upload is disabled while preserving drag-and-drop behavior. No actionable merge-blocking risk remains after the reported verification checks. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ 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
role="button"whenopenFileDialogOnClick={false}When click upload is disabled, rc-upload already replaces its click and key handlers with no-ops. Keeping button semantics and
tabIndex=0therefore exposes a focusable control that cannot be activated. Drag-and-drop behavior remains unchanged.Closes #294.
Verification
tabIndex=0npm run tscnpm run lint— 0 errors, 8 pre-existing unused-disable warningsnpm run compile— ESM, CJS, and declarations passedprettier --check src/AjaxUploader.tsx tests/uploader.spec.tsxgit diff --checkI checked all current open PR titles and changed files before implementation. Several older PRs touch
AjaxUploader.tsx, but none addresses theopenFileDialogOnClick={false}button semantics.AI assistance disclosure: Codex was used to trace the current render contract, audit open-PR overlap, add the focused regression, and run verification. The exact-base failure and final diff were reviewed locally.
Summary by CodeRabbit
Bug Fixes
Tests