fix: omit inert row click handlers - #1510
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; 2 remain after this review. Walkthrough本次变更使行仅在配置行点击回调或可展开行点击行为时创建 Changes行点击行为
Estimated code review effort: 1 (简单) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change omits inert row click handlers while preserving configured row callbacks and expandable-row behavior. It is localized and merge-ready after normal checks, with no actionable merge-blocking risk remaining. Suggested reviewers: 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 failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages. 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
onClickprop when neitheronRow.onClicknor an applicableexpandRowByClickaction existsWhy
useRowInfocurrently creates and passes anonClickfunction for every body row, even when that function has no possible action. Accessibility tooling and some screen readers can therefore expose ordinary table rows or their cells as clickable despite there being nothing to activate. This is the behavior reported in #1228.The new condition removes only inert handlers. Rows still receive the composed click handler whenever a consumer supplied
onRow.onClick, or whenexpandRowByClickapplies to that row. The existing event and expansion coverage continues to pass unchanged.On exact base
7977f2b45a501728dddf0853466c1a013a7190dc, the new regression received anonClickfunction for every default row and failed. It passes after this change withonClickomitted.Fixes #1228.
Validation
npm test— 21 files, 237 testsnpm run tscnpm run lint— 0 errors; 23 existing warningsnpx prettier --check src/hooks/useRowInfo.tsx tests/Table.spec.jsxnpm run compile— ESM, CJS, declarations, and Lessgit diff --checkAI assistance disclosure: Codex was used to trace the unconditional handler, audit existing issue and PR overlap, draft the focused regression and minimal condition, and run the validation listed above. The failure and fixed behavior were verified locally against the cited exact base and PR head.
Summary by CodeRabbit
Bug Fixes
Tests