Skip to content

Fix: Refine row click behavior for selection and deselection#4762

Open
edmundophie wants to merge 4 commits into
tabulator-tables:masterfrom
edmundophie:fix/deselect-range-selection-issue
Open

Fix: Refine row click behavior for selection and deselection#4762
edmundophie wants to merge 4 commits into
tabulator-tables:masterfrom
edmundophie:fix/deselect-range-selection-issue

Conversation

@edmundophie
Copy link
Copy Markdown

@edmundophie edmundophie commented Jun 24, 2025

This PR is to address an issue reported in #4442

Current State

  1. Select any row
  2. Selecting the same row doesn't deselect it

Expected State

  1. Select any row
  2. Selecting the same row again will deselect it

Description

This PR tries to achieve the following behavior when a row is clicked without SHIFT/CTRL:

  • If the clicked row is the only selected row: Deselect it.
  • If the clicked row is one of multiple selected rows: Make it the only selected row (deselect others).
  • If the clicked row is not currently selected: Deselect all others and select the clicked row.

This commit modifies the handleComplexRowClick function in the SelectRow module to correctly handle this scenario. Now, clicking an already selected row will deselect it, only if only it was the only one being selected previously.

google-labs-jules Bot and others added 2 commits June 24, 2025 07:43
When multiple rows are selected using SHIFT + click, clicking on an individual row within that selection did not deselect it.

This commit modifies the `handleComplexRowClick` function in the `SelectRow` module to correctly handle this scenario. Now, clicking an already selected row will deselect it, regardless of how it was initially selected.
@edmundophie edmundophie changed the title Fix: Allow deselection of rows within a range selection Fix: Refine row click behavior for selection and deselection Jun 24, 2025
Copy link
Copy Markdown
Collaborator

@azmy60 azmy60 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no way to deselect a row, so I agree with this. Thanks for contributing!

@azmy60 azmy60 added the PR Awaiting Merge The PR is awaiting merge in next release version label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR Awaiting Merge The PR is awaiting merge in next release version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants