Make WordPress Core

Opened 6 months ago

Closed 6 months ago

#41803 closed defect (bug) (fixed)

themes.php search form doesn't work when submitted

Reported by: boonebgorges Owned by: afercia
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.8
Component: Themes Keywords: has-patch
Focuses: javascript Cc:


wp-admin/themes.php has a live search powered by Backbone. But if you enter a term and hit 'Enter', forcing a proper form submit, you're led back to themes.php *without* the search URL param being filled in.

Could we do one of the following?

  1. Prevent form submission here, either by preventDefault() on submit, or by rejecting the Enter key
  2. Add name="search" to the live search input attributes, so that form submission works normally

Previously: #34881 - cc @afercia

Attachments (1)

41803.diff (557 bytes) - added by afercia 6 months ago.

Download all attachments as: .zip

Change History (7)

#1 @afercia
6 months ago

@boonebgorges I can't reproduce on previous 4.7 where the form submission seems correctly prevented. Maybe something missed with recent changes in 4.8.

#2 @boonebgorges
6 months ago

@afercia [40572] added a <form> element around the input. In 4.7, there was no form, so hitting Enter didn't do anything.

#3 @afercia
6 months ago

  • Keywords needs-patch added; 2nd-opinion removed

I guess because in 4.7 there wasn't a <form> element wrapping the search field, see [40572]  😬

6 months ago

#4 @afercia
6 months ago

  • Focuses javascript added; administration removed
  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 4.9

@boonebgorges 41803.diff should fix it, mind a quick test? Thanks!

#5 @boonebgorges
6 months ago

@afercia Yes, this works for me.

#6 @afercia
6 months ago

  • Owner set to afercia
  • Resolution set to fixed
  • Status changed from new to closed

In 41337:

Themes: Prevent the Themes search field default action after [40572].

Props boonebgorges.
Fixes #41803.

Note: See TracTickets for help on using tickets.