Skip to content

DataViews: Fix row selection in table layout in Firefox#73945

Merged
talldan merged 3 commits intotrunkfrom
fix/dataview-table-prevent-firefox-cell-selection
Dec 12, 2025
Merged

DataViews: Fix row selection in table layout in Firefox#73945
talldan merged 3 commits intotrunkfrom
fix/dataview-table-prevent-firefox-cell-selection

Conversation

@talldan
Copy link
Contributor

@talldan talldan commented Dec 12, 2025

What?

Fixes #73910

Why?

Firefox has a unique feature compared to other browsers, Cmd/Ctrl + Click on a table cell selects the table cell. Try it below (Cmd + Click on a mac, Ctrl + Click on other platforms):

Header Header Header
Cell Cell Cell
Cell Cell Cell
Cell Cell Cell

For the dataviews table layout, it already uses the same shortcut for table row selection. I think the Firefox behavior isn't something that's expected to happen, and it stops the row selection behavior from working, so this PR prevents it.

How?

If the browser is firefox, and the user ctrl/cmd + left clicks, prevent the default behavior.

Testing Instructions (in Firefox)

  1. Checkout this branch and run npm run storybook:dev
  2. Navigate to the DataViews > Default story
  3. Cmd + Click (on a Mac) or Ctrl + Click (on other platforms) on a row in the table
  4. The table row should be selected

@talldan talldan self-assigned this Dec 12, 2025
@talldan talldan added [Type] Bug An existing feature does not function as intended [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Dec 12, 2025
@talldan talldan marked this pull request as ready for review December 12, 2025 02:41
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: talldan <[email protected]>
Co-authored-by: tellthemachines <[email protected]>
Co-authored-by: jameskoster <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@talldan talldan changed the title DataViews: Prevent Firefox cell selection in table layouts DataViews: Fix row selection in table layout in Firefox Dec 12, 2025
Copy link
Contributor

@tellthemachines tellthemachines left a comment

Choose a reason for hiding this comment

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

LGTM! Tested in Firefox and can confirm this fixes the issue.

@talldan talldan merged commit 96f35c0 into trunk Dec 12, 2025
41 checks passed
@talldan talldan deleted the fix/dataview-table-prevent-firefox-cell-selection branch December 12, 2025 03:34
@github-actions github-actions bot added this to the Gutenberg 22.4 milestone Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ctrl/cmd clicking table rows to multi-select doesn't work in Firefox

2 participants