# When focus returns to search box, auto highlight all text

**URL:** https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125
**Category:** UX
**Created:** [September 11, 2015, 2:41pm UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125 "2015-09-11T14:41:33Z")
**Posts on this page:** 12
**Page:** 2

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [September 16, 2015, 12:30pm UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/21 "2015-09-16T12:30:16Z")

</div>

> [@sam](#):
>
> Google the mega search giant is not issuing a “select” on text in the box on focus

They do when you’re using chrome (Crtl + F), inbox and gmail. Could be “scale” thing, they feel like you’re going to refine web searches more than searches to your personal data.

> [@sam](#):
>
> must be an extension.

How about making the behavior different depending on if the search is launched using a keyboard shortcut (highlight) versus clicking on the icon (no highlight). Or at least clearing the previous search terms out after awhile.

Our Discourse instance is multi purpose and at least 80% of the time, when I search, I want to perform a new search, not refine a search that I might have performed a few hours ago. When I return to [google.com](http://google.com) after running a search, it doesn’t have the same search term listed there that I had hours ago, but Discourse seems to hang onto the search term idefintiely.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 16, 2015, 12:38pm UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/22 "2015-09-16T12:38:16Z")

</div>

> [@wesochuck](#):
>
> gmail

gmail does not exhibit this behavior, if I search for something and then click the search box cursor shows up.

This is so super bikesheddy to me, why is double clicking the text box so hard?

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [September 16, 2015, 12:40pm UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/23 "2015-09-16T12:40:59Z")

</div>

> [@sam](#):
>
> gmail does not exhibit this behavior, if I search for something and then click the search box cursor shows up

If you use the “/” shortcut it highlights (at least on Chrome + Mac).

> [@sam](#):
>
> super bikesheddy to me

I guess I view search workflows as more important that what color the bikeshed is, but I could be an outlier. Searching is a **primary** function _for me_ with any system that contains buckets of text.

> [@sam](#):
>
> why is double clicking the text box so hard

Because you launched the search using the keyboard shortcut.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 16, 2015, 12:49pm UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/24 "2015-09-16T12:49:41Z")

</div>

> [@wesochuck](#):
>
> If you use the “/” shortcut it highlights (at least on Chrome + Mac).

not following, our / also highlights?

> [@wesochuck](#):
>
> Because you launched the search using the keyboard shortcut.

My #1 objection here is for “click” on `INPUT` to unconditionally highlight text. Its odd and very uncommon.

There are so many other quirks that need to be fixed first and so many other features that need to be fixed.

For example, if you are on `full page search` and hit `/` we pop up the search window, which is odd, you are already in a search page, it should go to the INPUT that is visible on the page.

In fact even showing the magnifying glass when you are on full page search is weird.

Fine for increasing usability, but want to focus on stuff that is uncontroversial first.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [September 16, 2015, 12:57pm UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/25 "2015-09-16T12:57:16Z")

</div>

> [@sam](#):
>
> not following, our / also highlights?

It doesn’t on build v1.4.0.beta10 +300; but if it does now, I’m fine with that. Auto-highlight on mouse click is not that important to me, auto-highlight on keyboard shortcut was my biggest pain point.

> [@sam](#):
>
> There are so many other quirks that need to be fixed first and so many other features that need to be fixed

Sure, that is why I posted to _ux_ instead of _feature_. I assumed ux discussions got a lower priority in the dev cycle.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [September 16, 2015, 1:24pm UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/26 "2015-09-16T13:24:42Z")

</div>

> [@sam](#):
>
> not following, our / also highlights?

Icic no wonder you didn’t remove the code for that. I’m fine with highlight on click being removed too. It wasn’t too much of a pain.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 18, 2015, 2:23am UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/27 "2015-09-18T02:23:58Z")

</div>

I amended the behavior of search in the [full page search](http://meta.discourse.org/search)

_If on the full page search_

- When you click on header magnifying glass we simply highlight the search term in the full page search box

- When you hit / we highlight the search term for full page search

Effectively this means there is just one way of searching when you are on [Search results for '' - Discourse Meta](https://meta.discourse.org/search) , which in my books is good 🌻

[https://github.com/discourse/discourse/commit/086d31d53b4902238ec9e10207c219402e6437b4](https://github.com/discourse/discourse/commit/086d31d53b4902238ec9e10207c219402e6437b4)

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [June 28, 2016, 12:57pm UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/28 "2016-06-28T12:57:06Z")

</div>

Did a regression occur here at some point? The search term highlighting no longer seems to work for me on my latest local build or here on meta.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 28, 2016, 11:36pm UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/29 "2016-06-28T23:36:34Z")

</div>

Aha this is probably a regression we missed in earlier vdom changes @sam

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 6, 2016, 3:56am UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/30 "2016-07-06T03:56:23Z")

</div>

We should fix this @eviltrout

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 8, 2016, 6:18am UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/34 "2016-07-08T06:18:31Z")

</div>

Fixed in  
[https://github.com/discourse/discourse/commit/e619af3eeeb73fe7a28505c39d5c20eb8d86c3db](https://github.com/discourse/discourse/commit/e619af3eeeb73fe7a28505c39d5c20eb8d86c3db)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 8, 2016, 6:34am UTC](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125/35 "2016-07-08T06:34:04Z")

</div>



[Previous page](https://meta.discourse.org/t/when-focus-returns-to-search-box-auto-highlight-all-text/33125.md?page=1)
