Skip to content

Themes: Allow repeating the same theme search after the search field is cleared. - #16298

Draft
SainathPoojary wants to merge 1 commit into
WordPress:trunkfrom
SainathPoojary:fix/66849
Draft

SainathPoojary wants to merge 1 commit into
WordPress:trunkfrom
SainathPoojary:fix/66849

Conversation

@SainathPoojary

Copy link
Copy Markdown
Member

On the Add Themes screen, searching for the same term a second time does nothing when the search field was cleared by clicking "Feature Filter" or a tab like "Popular".

clearSearch() empties the search input, but the search view still remembers the last term in terms. When the same term is entered again (typed or picked from browser autocomplete), doSearch() sees it matches terms and returns early, so no search runs. The filter panel stays open and the results and count do not update.

This resets SearchView.terms in clearSearch() so the next search always runs.

Testing steps

  1. Go to Appearance → Themes → Add Themes.
  2. Search for twenty and wait for the results.
  3. Click "Feature Filter". The search field is emptied.
  4. Enter twenty again (paste it or pick it from the autocomplete list).
  5. Before: nothing happens, and the filter panel stays open.
    After: the search runs, the filter panel closes, and matching themes are shown.

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

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Claude Code helped with the code changes. Review and testing the changes was done by me


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.

@github-actions

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