fix: preserve item click on keyboard activation - #395
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 2 included reviews per hour; 1 remains after this review. WalkthroughStep 组件改用 Changes键盘事件流
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change preserves item clicks and parent callbacks for Enter and Space activation while preventing Space from scrolling the page. 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)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #395 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 99 99
Branches 38 38
=========================================
Hits 99 99 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
onClickand the Steps-level change callback for keyboard usersProblem
A clickable Step exposes
role="button", but its keyboard handler called only the parentonClick(index)path. Mouse activation also calls the public item-levelonClick, so the same Step behaved differently depending on input method. Space activation additionally left its page-scroll default intact.The exact-base regression invoked Enter and Space and received two parent changes but zero item callbacks. The fix reuses
currentTarget.click(), keeping the existing click behavior as the single activation path.Validation
npm test: 2 suites, 24 tests, 13 snapshotsnpm run tscnpm run lintnpm run compile: ESM, CJS, declarations, Lessgit diff --checkAI assistance disclosure: Codex was used to trace the input-specific callback paths, write and run the failing regression, audit open-PR file overlap, and draft this description. I verified the exact-base failure and all fixed-head validation locally.
Summary by CodeRabbit
Bug 修复
测试