fix: prevent duplicate select event dispatch in Dataframe component#13009
Closed
gambletan wants to merge 1 commit intogradio-app:mainfrom
Closed
fix: prevent duplicate select event dispatch in Dataframe component#13009gambletan wants to merge 1 commit intogradio-app:mainfrom
gambletan wants to merge 1 commit intogradio-app:mainfrom
Conversation
When clicking a cell, handle_cell_click was called both on mousedown (in start_drag) and on mouseup (in end_drag), causing the select event to fire twice. Remove the redundant call in end_drag since start_drag already handles cell click for non-drag interactions. Fixes gradio-app#12054
Member
|
Don’t delete our template. Disclosure rules not followed |
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
Fixes #12054
selectevent was being dispatched twice when clicking a Dataframe cell becausehandle_cell_clickwas called both onmousedown(instart_drag) and onmouseup(inend_drag) indrag_utils.tshandle_cell_clickcall fromend_drag, sincestart_dragalready handles the cell click and select event dispatch for non-drag (simple click) interactionsend_dragonly needs to clean up drag state and restore focusTest plan
selectevent handler (fnin.select(fn=...)) is called exactly once