-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Views: Ignore cmd-click when row not selectable #59697
Conversation
In `ViewGrid`, move the check for `hasBulkAction` out of the condition and into the block of the outer `if` statement. This is done so that the event mechanics remain the same whether the row is selectable or not; in particular, the statements to event stop propagation and prevent default shouldn't be predicated on that ability.
Size Change: +8 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the issue in my tests and the code change looks good. Thank you for this fix @mcsf!
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Fixes #59563 (comment)
What?
When using cmd + click on an item that isn't selectable, simply ignore that event, thereby preventing the item's checkbox from flashing from checked to unchecked. This was already the case in the Grid view, and this pull request applies the same idea to Table view.
How?
In
ViewTable
, check the value ofhasPossibleBulkAction
before proceeding with selection changes.In
ViewGrid
, move the check forhasBulkAction
out of the condition and into the block of the outerif
statement. This is done so that the event mechanics remain the same whether the row is selectable or not; in particular, the statements to event stop propagation and prevent default shouldn't be predicated on that ability.Testing Instructions
See report in #59563 (comment).