WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 17 months ago

#15355 reopened enhancement

Add ability to clear search results

Reported by: nacin Owned by: garyc40
Milestone: Future Release Priority: normal
Severity: normal Version: 3.5.2
Component: Administration Keywords: has-patch reporter-feedback
Focuses: ui Cc:

Description

Let's put a (X) next to "Search results for string" that immediately clears the search results. Otherwise there is no way to do it, without clearing the box manually and hitting enter.

We would use the same X we use for bulk edit.

Attachments (6)

clear_search.15355.patch (10.3 KB) - added by ocean90 5 years ago.
First pass
clear_search.2.15355.patch (13.0 KB) - added by ocean90 5 years ago.
With _search_results_subtitle()
garyc40.15355.diff (2.6 KB) - added by garyc40 4 years ago.
put #clear-search inside search box
garyc40.15355.2.diff (2.7 KB) - added by garyc40 4 years ago.
correct search box padding when X button is displayed
searchbox.png (9.2 KB) - added by garyc40 4 years ago.
screenshot
garyc40.15355.3.diff (2.7 KB) - added by garyc40 4 years ago.
check $_REQUEST['s'] instead of is_search()

Download all attachments as: .zip

Change History (27)

comment:1 @westi5 years ago

Patches Welcome

comment:2 @ocean905 years ago

  • Owner set to ocean90
  • Status changed from new to accepted

comment:3 @ocean905 years ago

  • Keywords has-patch added; needs-patch removed

@ocean905 years ago

First pass

comment:4 @ocean905 years ago

  • Keywords ui-feedback added

@ocean905 years ago

With _search_results_subtitle()

comment:5 @JohnONolan5 years ago

Can this go in post UI-freeze? If so, should definitely be run past Jane first

comment:6 @nacin5 years ago

I proposed it to Jane originally and she approved it before I ticketed it.

However, I'm wondering if we're putting the X in the wrong spot now: Think maybe it should go in the search box itself. Koopersmith and I were considering that for internal linking as well.

comment:7 @JohnONolan5 years ago

My preference would indeed be to have it in the search box. The search box is an expected place for a user interaction in order to modify or delete a search term, the heading of the page maybe not so much.

comment:8 @JohnONolan5 years ago

  • Milestone changed from 3.1 to Future Release

comment:9 @ocean905 years ago

  • Keywords needs-patch added; has-patch ui-feedback removed

comment:10 @JohnONolan5 years ago

  • Keywords needs-ui early-3.2 added

comment:11 @voyagerfan57615 years ago

  • Cc WordPress@… added

comment:12 @aaroncampbell4 years ago

  • Keywords 3.2-early added; early-3.2 removed

comment:13 @garyc404 years ago

  • Owner changed from ocean90 to garyc40
  • Status changed from accepted to assigned

@garyc404 years ago

put #clear-search inside search box

@garyc404 years ago

correct search box padding when X button is displayed

@garyc404 years ago

screenshot

@garyc404 years ago

check $_REQUEST['s'] instead of is_search()

comment:14 @garyc404 years ago

  • Keywords has-patch added; needs-patch removed

comment:15 @scribu4 years ago

  • Keywords added; 3.2-early removed

Out of scope for 3.2.

comment:16 @jane4 years ago

  • Keywords removed

In the search box would make more sense, but realistically if the search is cleared, then it returns to the list table, no? Possibly a link to return to list table would be the easier approach?

comment:17 @ocean903 years ago

With [20168] Webkit browsers will have the X inside the search box, but it clears only the input field.

comment:18 @sethshoultes2 years ago

  • Keywords dev-feedback added
  • Resolution set to worksforme
  • Status changed from assigned to closed
  • Version set to 3.5.2

What is the status of this ticket? I see the X (using webkit browsers) while testing the latest versions of WordPress (3.5 and 3.6). Are there plans to try making this work for non-webkit browsers?

Also, regarding this comment:
"In the search box would make more sense, but realistically if the search is cleared, then it returns to the list table, no? Possibly a link to return to list table would be the easier approach?"

I agree that a link to return to the list table makes. Maybe a new ticket should be created for that (if one has not been created already). However, if I understand the statement correctly, I don't agree that you should be returned to the table list, when clicking the X within the search box. It makes more sense to me that you just want to clear the text field when clicking the X.

comment:19 @helen2 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Sounds like the original idea was not about an X in the input field, which of course should just clear the field and nothing else.

comment:20 @sethshoultes2 years ago

Sorry! I didn't mean to close this ticket.

comment:21 @helen17 months ago

  • Focuses ui added
  • Keywords reporter-feedback added; needs-ui dev-feedback removed

Do we still want this?

Note: See TracTickets for help on using tickets.