Repository navigation
Fix stopPropagation() and preventDefault() on cell events - #4217
Merged
Merged
Conversation
nstepien
added this pull request to stack #4218
October 21, 2026 22:07
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4217 +/- ##
=======================================
Coverage 98.35% 98.36%
=======================================
Files 45 45
Lines 1951 1955 +4
Branches 727 727
=======================================
+ Hits 1919 1923 +4
Misses 32 32
🚀 New features to boost your workflow:
|
Cell events inherit from React's event, but React's `stopPropagation()` and `preventDefault()` store their state on the object they're called on. Calling them on a cell event updated the cell event instead of React's event, so React kept calling parent handlers after `stopPropagation()`, and parent handlers saw `isDefaultPrevented()` return `false` after `preventDefault()`. Call them on React's event instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nstepien
force-pushed
the
cell-event-propagation
branch
from
October 21, 2026 23:05
f5fc5a5 to
2e39b26
Compare
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.
Stacked on #3967.
Cell events inherit from React's event, but React's
stopPropagation()andpreventDefault()store their state on the object they're called on. When called on a cell event, they updated the cell event instead of React's event, so:stopPropagation()inonCellClick,onCellKeyDown, or another cell event handler didn't stop React from calling parent handlers.preventDefault(), parent handlers sawisDefaultPrevented()returnfalse.The native event was still updated, so the browser's default action was prevented.
This predates #3967: cell events used to copy React's event, with the same result.
Cell events now call these two methods on React's event. The two new tests failed in all three browsers before the fix.
🤖 Generated with Claude Code