Repository navigation
fix: guard onClick invocation when Steps has no onChange - #400
Conversation
|
@feritcemkahraman 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
Walkthrough步骤的顶层 Changes步骤点击回调
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #400 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 97 97
Branches 36 37 +1
=========================================
Hits 97 97 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
When is rendered without an onChange prop, props.onClick passed to is undefined (onClick={onChange && onStepClick}).
In Step.tsx, clickable is computed as: !!(onClick || onItemClick) && !disabled;
If an item defines an item-level onClick (onItemClick), clickable evaluates to true. However, accessibilityProps.onClick unconditionally invoked onClick(index), resulting in a TypeError: onClick is not a function runtime crash when Steps does not supply an onChange callback.
Fix
Validation
Summary by CodeRabbit