fix(Cell): restore clickable behavior when to or url prop is set - #13894
Open
haoku123 wants to merge 1 commit into
Open
fix(Cell): restore clickable behavior when to or url prop is set#13894haoku123 wants to merge 1 commit into
haoku123 wants to merge 1 commit into
Conversation
v4.10.0 (youzan#13846) changed onClick to only bind when clickable is true, but the clickable computation only considered the clickable and isLink props. Cells that relied on the implicit clickable behavior of the to / url props (working since before v4.10.0) stopped routing. Include to / url in the clickable computation while keeping the explicit clickable={false} opt-out. Fixes youzan#13868
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13894 +/- ##
==========================================
- Coverage 89.60% 89.41% -0.20%
==========================================
Files 257 257
Lines 7013 6698 -315
Branches 1736 1675 -61
==========================================
- Hits 6284 5989 -295
+ Misses 384 374 -10
+ Partials 345 335 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #13868: since v4.10.0, Cells that only set the
toorurlprop (without an explicitclickable) no longer route on click.Root Cause
v4.10.0 (#13846,
fix(Field): prevent click event when disabled with is-link) changedonClickto only bind whenclickableis true, but theclickablecomputation only considered theclickableandisLinkprops. The implicit clickable behavior ofto/url(working since before v4.10.0) was silently dropped.Changes
Cell.tsx: includeto/urlin the clickable computation:??chain keeps the explicit opt-out:clickable={false}still disables interaction (existing test still passes).to-only andurl-only cells.Verification
rstest run src/cell/test: 15/15 passed (2 new)rstest run src/field/test: 52/52 passed — confirms fix(Field): prevent click event when disabled with is-link #13846's disabled+is-link fix is not regressed