fix: Prevent double triggering of select event for Dataframe.#13019
Closed
mendonca4 wants to merge 1 commit intogradio-app:mainfrom
Closed
fix: Prevent double triggering of select event for Dataframe.#13019mendonca4 wants to merge 1 commit intogradio-app:mainfrom
mendonca4 wants to merge 1 commit intogradio-app:mainfrom
Conversation
The handle_cell_click function was being triggered twice due to both mousedown and mouseup events firing. Introduced a click_handled flag to ensure the click is only processed once per user interaction. Fixes gradio-app#12054
Collaborator
|
Hi @mendonca4 - the Gradio dataframe currently relies on the @gradio/dataframe-interim node package. These changes would not fix the issue. |
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.
Fixes #12054
Description
The
selectevent was being triggered twice when clicking a cell in the Dataframe component.Both
mousedownandmouseupevents were callinghandle_cell_click,causing the event handler to fire twice per user interaction.
Changes:
click_handledflag inDragStateto ensure the clickis only processed once per user interaction
end_dragto checkclick_handledbefore callinghandle_cell_clicksame_cellcheck to prevent redundant calls when clickingon the same cell after a drag event
Closes: #12054
AI Disclosure
🎯 PRs Should Target Issues
Closes #12054