Skip to content

fix: Prevent double triggering of select event for Dataframe.#13019

Closed
mendonca4 wants to merge 1 commit intogradio-app:mainfrom
mendonca4:fix/issue-12054
Closed

fix: Prevent double triggering of select event for Dataframe.#13019
mendonca4 wants to merge 1 commit intogradio-app:mainfrom
mendonca4:fix/issue-12054

Conversation

@mendonca4
Copy link
Copy Markdown

Fixes #12054

Description

The select event was being triggered twice when clicking a cell in the Dataframe component.
Both mousedown and mouseup events were calling handle_cell_click,
causing the event handler to fire twice per user interaction.

Changes:

  • Introduced a click_handled flag in DragState to ensure the click
    is only processed once per user interaction
  • Updated end_drag to check click_handled before calling
    handle_cell_click
  • Added a same_cell check to prevent redundant calls when clicking
    on the same cell after a drag event

Closes: #12054

AI Disclosure

  • I did not use AI

🎯 PRs Should Target Issues

Closes #12054

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
@freddyaboulton
Copy link
Copy Markdown
Collaborator

Hi @mendonca4 - the Gradio dataframe currently relies on the @gradio/dataframe-interim node package. These changes would not fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select event triggered twice for Dataframe object

2 participants