[wp-trac] [WordPress Trac] #65298: Searched text is not cleared from the Library search bar after refresh
WordPress Trac
noreply at wordpress.org
Thu Jun 4 09:24:28 UTC 2026
#65298: Searched text is not cleared from the Library search bar after refresh
-------------------------------------------------+-------------------------
Reporter: abduremon | Owner:
| westonruter
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 7.1
Component: Administration | Version: 4.9
Severity: major | Resolution:
Keywords: has-screenshots has-patch needs- | Focuses:
testing | administration
-------------------------------------------------+-------------------------
Comment (by rejaulalomkhan):
== Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/11938
=== Environment
* WordPress: 7.1-alpha-20260522.071116
* Subdirectory: No
* PHP: 8.3.31
* Server: PHP.wasm
* Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
* Browser: Chrome 148.0.0.0
* OS: Windows 10/11
* Theme: Twenty Twenty-Five 1.5
* MU Plugins: None activated
* Plugins:
* Test Reports 1.3.0
=== Steps taken
1. Navigated to the Media Library section in Grid View.
2. Entered a search term (e.g., "test") into the search bar and pressed
Enter.
3. Observed that the URL updated to include `?search=test`.
4. Manually cleared all text from the search bar.
5. Observed that the URL successfully reset back to `upload.php` (the
`?search=` parameter was completely removed).
6. Refreshed the page.
7. Verified that the search bar remained empty and did not reload the old
search term.
8. ✅ Patch is solving the problem
=== Expected result
* When the search text is cleared from the Media Library search bar, the
`?search=` query parameter should be automatically removed from the
browser URL. On page refresh, the search field should remain completely
empty.
=== Additional Notes
* The patch successfully triggers `gridRouter.navigate()` when the input
is empty, ensuring the stale URL parameter is wiped out and doesn't reload
old queries upon refreshing.
=== Screenshots/Screencast with results
* [[Image(https://i.ibb.co.com/wZpgs5Rx/Test-
Screenshot-2026-06-04-151259.png)]]
* [[Image(https://i.ibb.co.com/GQNWgjgv/Test-solved-
Screenshot-2026-06-04-151547.png)]]
=== Support Content
* Website Playground URL with parameters: https://playground.wordpress.net
/?core-pr=11938
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65298#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list