Skip to content

Administration: Preserve the row selection after Quick Edit. - #16529

Open
umeshnevase wants to merge 1 commit into
WordPress:trunkfrom
umeshnevase:fix/quick-edit-preserve-row-checkbox
Open

umeshnevase wants to merge 1 commit into
WordPress:trunkfrom
umeshnevase:fix/quick-edit-preserve-row-checkbox

Conversation

@umeshnevase

Copy link
Copy Markdown

When an item is selected in a list table and then saved with Quick Edit, the row is replaced with freshly rendered markup from the server, and that markup always has an unchecked checkbox. The edited row ends up unchecked while the "Select all" checkboxes in the table header and footer stay checked. A bulk action such as Delete then silently skips the edited item.

This PR remembers the checked state of the row before it is replaced and restores it on the new row, so the row keeps the state it had before Quick Edit.

  • inline-edit-post.js: covers Posts, Pages and custom post types.
  • inline-edit-tax.js: covers Tags, Categories and other taxonomies.
  • edit-comments.js: covers Comments. This is only done when editing a comment, so a new reply is not selected.

Testing

Reproduce on trunk, then repeat on this branch:

  1. Go to Posts → Tags (wp-admin/edit-tags.php?taxonomy=post_tag). Repeat on Posts → All Posts, Pages, and Comments.
  2. Check the "Select all" checkbox in the table header.
  3. Quick Edit a row, change a value, and save.
  4. Expected: the edited row is still checked, matching the header and footer checkboxes. Before the patch, the row was unchecked.
  5. Also try selecting only some rows, and Quick Editing a row that was not selected. It should stay unchecked.

I also ran the QUnit suite with the new tests (npx playwright test --config tests/qunit/playwright.config.js). The new tests fail on trunk and pass with this change.

New QUnit tests cover inlineEditPost.save(), inlineEditTax.save() and commentReply.show(): a selected row stays selected, an unselected row stays unselected, partial selection, consecutive saves, a response with no checkbox, failed saves, and (for comments) pending comments and replies.

Trac ticket: https://core.trac.wordpress.org/ticket/66945

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5.5
Used for: Reproducing the issue, drafting the fix and the QUnit tests, and checking them in the browser. I reviewed the changes and take responsibility for them.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

When a row in a list table is selected and then saved with Quick Edit, the row was replaced with freshly rendered markup, which has an unchecked checkbox. The row ended up unchecked while the "Select all" checkboxes in the table header and footer stayed checked, so a bulk action would skip the edited item.

Remember the checked state of the row before it is replaced and restore it on the new row. This applies to the Posts, Pages and custom post types, Tags and Categories (and other taxonomies), and Comments list tables. A new reply to a comment is not selected.

Add QUnit tests for `inlineEditPost.save()`, `inlineEditTax.save()` and `commentReply.show()`.
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props umeshnevase.

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

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.

1 participant