auto-highlight search terms on subsequent search

RESOLVED FIXED

Status

Webmaker
webmaker.org
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: epilepticrabbit, Assigned: Kevin Kofler)

Tracking

Details

(Whiteboard: [good first bug][mentor=mjschranz])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
STR:

Do a search for something that has no results (e.g. unicornbutt)
click in the search box and search for something else

Expected:
the search should auto highlight the text so your next search is "new"

Actual:
the user types and the previous search term is still in the box. The user has to delete the text or suffer accidentally searching for unicornbuttpopcorn
(Assignee)

Comment 1

4 years ago
Is this bug still open? Does anyone mind if I work on a fix?
Nope still a bug for sure! Feel free to take this.

Also Laura, I think I have to go tag a project unicornbutt now.
Assignee: nobody → kwkofler
Status: NEW → ASSIGNED
Whiteboard: [good first bug][mentor=mjschranz]
(Assignee)

Comment 3

4 years ago
Created attachment 8343099 [details] [diff] [review]
https://github.com/mozilla/webmaker.org/pull/540

Should be good to go, unless you want this implemented in another way.
Attachment #8343099 - Flags: review?(schranz.m)
Comment on attachment 8343099 [details] [diff] [review]
https://github.com/mozilla/webmaker.org/pull/540

The right solution is to build this functionality into the page specific JS files we use to control UI.

In this case that's https://github.com/mozilla/webmaker.org/blob/master/public/js/pages/search.js where we have a reference to the input element as a jQuery object in $searchField. You should be able to tie event listening to that object that will do the same sort of thing you did inline in the element.
Attachment #8343099 - Flags: review?(schranz.m) → review-
(Assignee)

Comment 5

4 years ago
Comment on attachment 8343099 [details] [diff] [review]
https://github.com/mozilla/webmaker.org/pull/540

Is this better?
Attachment #8343099 - Flags: review- → review?(schranz.m)
Comment on attachment 8343099 [details] [diff] [review]
https://github.com/mozilla/webmaker.org/pull/540

You need to remove the previous changes that have this happening inline in the HTML.

Also, I think simply doing http://api.jquery.com/select/#select and not using trigger for focus should suffice. At least, it seems to do the trick locally for me.
Attachment #8343099 - Flags: review?(schranz.m) → review-
(Assignee)

Comment 7

4 years ago
Comment on attachment 8343099 [details] [diff] [review]
https://github.com/mozilla/webmaker.org/pull/540

Well that was embarrassing -_- I removed the inline from my local test files, but not from the branch I was committing. The JQuery calls are reduced now, as well. Should be good?
Attachment #8343099 - Flags: review- → review?(schranz.m)
Comment on attachment 8343099 [details] [diff] [review]
https://github.com/mozilla/webmaker.org/pull/540

Great!

I'm going to go land this.
Attachment #8343099 - Flags: review?(schranz.m) → review+

Comment 9

4 years ago
Commit pushed to master at https://github.com/mozilla/webmaker.org

https://github.com/mozilla/webmaker.org/commit/0203e86355699943ba5e69475166fe324f2ed014
Fix Bug 938610 - Search bar now highlights search text on click.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Hey Dale,

Am I going crazy? It looks like that commit has been overwritten somehow on master.
You need to log in before you can comment on or make changes to this bug.