Fix click propagation for non-editable cells with editors#4891
Open
rathboma wants to merge 2 commits into
Open
Fix click propagation for non-editable cells with editors#4891rathboma wants to merge 2 commits into
rathboma wants to merge 2 commits into
Conversation
#4421) Add a failing unit test demonstrating that when a column defines an editor but the cell is not editable, the edit click handler calls e.stopPropagation() before checking editability. This swallows the click so it never reaches the table-level listener that powers the cellClick callback.
The edit click handler called e.stopPropagation() unconditionally whenever a column had an editor defined, before checking whether the cell was actually editable. When the cell was not editable the click was swallowed and never reached the table-level listener that powers the cellClick callback, so it never fired (regression since 5.6). Move the stopPropagation() call inside the editability check so it only runs when the cell will actually be edited, allowing clicks on non-editable cells to propagate normally.
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.
Summary
Fixed an issue where click events on non-editable cells were being stopped from propagating, preventing the
cellClickcallback from firing when a column had an editor defined but the cell itself was not editable.Changes
e.stopPropagation()call to only execute after confirming the cell is actually editable. Previously, the propagation was stopped before checking editability, which swallowed clicks on non-editable cells and prevented them from reaching parent listeners.Implementation Details
The fix ensures that:
cellClickcallback to firestopPropagation()is called relative to theallowEdit()checkThis resolves issue #4421 where the
cellClickevent was not firing for cells in columns with editors defined but marked as non-editable.https://claude.ai/code/session_01Nt4ggeWkoLbhrLcYwciwts