# Options to disable hijack of CMD+F / CTRL+F and "/" keys for search?

**URL:** https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875
**Category:** Feature
**Tags:** keyboard-shortcuts
**Created:** [25 ביוני,‏ 2014,‏ 9:04pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875 "2014-06-25T21:04:48Z")
**Posts on this page:** 20
**Page:** 2

<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: [8 ביולי,‏ 2014,‏ 2:43am UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/21 "2014-07-08T02:43:28Z")

</div>

That is now complete:

[https://github.com/discourse/discourse/commit/8e31fe4835c7f7a2028703c7c92deb75c7b4102e](https://github.com/discourse/discourse/commit/8e31fe4835c7f7a2028703c7c92deb75c7b4102e)

next up, decide if we want to keep CTRL-F on topic lists. I think we should drop that hijacking cause its really not offering full parity (no highlighting and so on)

---

<div class="post-metadata">

### Author: ![Lid](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@Lid](https://meta.discourse.org/u/Lid)
#### Post date: [8 ביולי,‏ 2014,‏ 6:45am UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/22 "2014-07-08T06:45:00Z")

</div>

You can technically “escape” the hijack by hitting CTRL+F twice  
tested in chrome and firefox

but do be prepare for some bugs (tested on chrome) with native find capabilities  
for example you **can’t** use Enter to go to the next match all the time because it triggered the “quote reply”  
which closes the native search.

---

<div class="post-metadata">

### Author: ![burke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/burke/32/4211_2.png) [@burke](https://meta.discourse.org/u/burke)
#### Post date: [7 באוגוסט,‏ 2014,‏ 6:54pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/23 "2014-08-07T18:54:12Z")

</div>

As an end-user, I gotta say that hijacking native browser search (Cmd+F) is unexpected behavior (aka a “bug”) from my perspective. I can click on the search icon and, if I hadn’t learned to use “/” for searching within an application from Gmail and the growing list of webapps that support it, I could learn it from the tooltip on the search button if it included it (e.g., `search topics, posts, users or categories ["/"]`).

I finally got frustrated enough with the hijacking to search for an option to disable it and discovered this topic. I didn’t realize that I could get the browser search button to work if I pressed it twice. Good to know. At a bare minimum, it might be nice to let people know within the search box… though it might be hard to fit along the bottom: `[] Search this topic (press browser search key [Cmd+F] again to get the expected behavior`). 😉

As it stands, my menu is Chrome contains an entry `Edit` \> `Find` \> `Find... ⌘F` that behaves differently than pressing the indicated ⌘F shortcut. IMHO, this is a side effect of Discourse unnecessarily breaking established conventions.

---

<div class="post-metadata">

### Author: ![brpc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brpc/32/114370_2.png) [@brpc](https://meta.discourse.org/u/brpc)
#### Post date: [7 באוגוסט,‏ 2014,‏ 8:47pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/24 "2014-08-07T20:47:56Z")

</div>

Pressing `CTRL (or CMD) + F` twice to “escape” the Discourse search is a bit of a kludge because having focus on an input field disables standard keyboard shortcuts.

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [7 באוגוסט,‏ 2014,‏ 9:38pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/25 "2014-08-07T21:38:07Z")

</div>

Technically, such a feature would be a [wart](http://www.catb.org/jargon/html/W/wart.html), but it has been argued before that it is actually a [miswart](http://www.catb.org/jargon/html/M/miswart.html). The reason being that due to the infinite scroll mechanic, a large portion of the topic may not actually be available to the browser, so the browser’s built-in Ctrl+F cannot work correctly. 😉

---

<div class="post-metadata">

### Author: ![brpc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brpc/32/114370_2.png) [@brpc](https://meta.discourse.org/u/brpc)
#### Post date: [7 באוגוסט,‏ 2014,‏ 10:04pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/26 "2014-08-07T22:04:34Z")

</div>

Oh, there’s no misunderstanding from me on that. I absolutely get the reasons as to _why_ it’s a good idea. The thing is, to me (and others, I suspect), the `CTRL/CMD+F` search paradigm is not about to change on the rest of the internet, so until Discourse proves the rest of the internet should change to follow their suit, then I’d prefer if the functionality was not forcefully hijacked. That’s really all. My personal preference would be to use an alternative shortcut like “/” (which now works, btw) and leave `CTRL/CMD+F` alone. Keyboard shortcuts have always been a “power user” thing anyway, so I don’t see this benefiting the average user as it is.

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [7 באוגוסט,‏ 2014,‏ 11:38pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/27 "2014-08-07T23:38:38Z")

</div>

Yeah, you’re right, I too would prefer Ctrl+F to work as usual. In hindsight I guess I came across a bit strong, but I had been leafing through the jargon file (it’s history for nerds; [_awesome_ history](http://www.catb.org/jargon/html/M/molly-guard.html)) and couldn’t help but shove that wart comment in there. 😅

---

<div class="post-metadata">

### Author: ![burke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/burke/32/4211_2.png) [@burke](https://meta.discourse.org/u/burke)
#### Post date: [8 באוגוסט,‏ 2014,‏ 2:55am UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/28 "2014-08-08T02:55:42Z")

</div>

> [@brpc](#):
>
> My personal preference would be to use an alternative shortcut like “/” (which now works, btw) and leave `CTRL/CMD+F` alone.

+1000 😄&nbsp;&nbsp;

---

<div class="post-metadata">

### Author: ![santouras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/santouras/32/108421_2.png) [@santouras](https://meta.discourse.org/u/santouras)
#### Post date: [8 באוגוסט,‏ 2014,‏ 3:42am UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/29 "2014-08-08T03:42:23Z")

</div>

> [@brpc](#):
>
> My personal preference would be to use an alternative shortcut like “/” (which now works, btw) and leave CTRL/CMD+F alone.

couldn’t agree more. I’m not sure why, but I don’t find the ctrl+f hijacking in google docs a problem, but it _really_ irks me in discourse. I guess this is because gdocs mimics and extends the browser search with highlighting, `[x] of [y]` results and up/down arrows. If discourse was able to do this I think it would be less annoying.

---

<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: [8 באוגוסט,‏ 2014,‏ 4:32am UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/30 "2014-08-08T04:32:04Z")

</div>

> [@brpc](#):
>
> My personal preference would be to use an alternative shortcut like “/” (which now works, btw) and leave CTRL/CMD+F alone.

Personally I want to **only** enable the hijacking on the topic page, and not on topic lists like we have now, @codinghorror I really think this should be reconsidered, cause I actually use “traditional” search on the other pages and we perform no unloading so there is not technical issue with enabling it.

That said … about the topic page …

I 100% support hijacking of CTRL-F on topic pages. What would we call this user preference?

“Enable extremely buggy browser search on topic page”

CTRL-F on topic pages is a trainwreck, open a composer hit CTRL-F its just totally messed up. As soon as you scroll to the spot it has highlighted it replaceState kicks in and clears the search results. Besides DOM unloading in larger topics which makes it simply look broken.

So, instead. I 100% support PRs to improve our in-topic search, perhaps one’s that mimic more of built-in one (like scrolling to highlighted spot and dealing with multiple matches in one post and so on.

I also very much think we should stop hijacking in all other spots.

---

<div class="post-metadata">

### Author: ![brpc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brpc/32/114370_2.png) [@brpc](https://meta.discourse.org/u/brpc)
#### Post date: [8 באוגוסט,‏ 2014,‏ 5:02pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/31 "2014-08-08T17:02:36Z")

</div>

> [@santouras](#):
>
> I guess this is because gdocs mimics and extends the browser search with highlighting, of [y] results and up/down arrows.

That’s a really really good point. I think this may be exactly why the Discourse implementation bothers me too.

> [@sam](#):
>
> So, instead. I 100% PRs to improve our in-topic search, perhaps one’s that mimic more of built-in one (like scrolling to highlighted spot and dealing with multiple matches in one post and so on.

This is very reasonable. I hope others will be able to help with this, because my ruby skills are next to non-existent (and I haven’t had much time to learn, or I would be doing so).

---

<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: [8 באוגוסט,‏ 2014,‏ 7:22pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/32 "2014-08-08T19:22:10Z")

</div>

> [@sam](#):
>
> Personally I want to only enable the hijacking on the topic page, and not on topic lists like we have now, @codinghorror I really think this should be reconsidered, cause I actually use “traditional” search on the other pages and we perform no unloading so there is not technical issue with enabling it.

Probably fine, but I don’t think people are complaining about the topic list here.

---

<div class="post-metadata">

### Author: ![TechnoBear](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/technobear/32/40546_2.png) [@TechnoBear](https://meta.discourse.org/u/TechnoBear)
#### Post date: [21 באוגוסט,‏ 2014,‏ 2:20pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/33 "2014-08-21T14:20:24Z")

</div>

I use Ctrl+F extensively to navigate topic lists on our (vBulletin) forum, and anticipate I will want to do the same after we move to Discourse, so I’m very much with @sam on this.

If the hijacking is to remain within a topic - and I fully understand the arguments in favour of that - could the shortcut menu please be annotated to indicate this?

I first discovered the hijacking yesterday when I pressed Ctrl+F, started to type and then realised I had somehow opened the Discourse search box by mistake. So I closed it and tried again, with (of course) the same result. Long years of experience with poor co-ordination has taught me that when unexpected things happen, it’s because I’ve hit the wrong keys by mistake, so I made a third attempt, carefully ensuring I got the intended keys, and only the intended keys. Still the search box opened. So I double-checked that I hadn’t accidentally activated Caps Lock, or any of the other things I’ve been known to do, but no. I checked the keyboard shortcut menu to see if something had changed, but it still showed the search shortcut as “/”. At this stage, I then _chose_ to open Discourse search, and discovered this and the related thread.

A brief note in the shortcut menu would have alerted me to this from the start and saved both time and frustration on my part.

---

<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: [21 באוגוסט,‏ 2014,‏ 6:43pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/34 "2014-08-21T18:43:13Z")

</div>

Press CTRL+F twice to get the browser native search. Warning: results can be bad on topic pages because stuff is unloaded from the browser DOM as you scroll.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [21 באוגוסט,‏ 2014,‏ 7:03pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/35 "2014-08-21T19:03:15Z")

</div>

Now that’s a neat trick 😄

---

<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: [21 באוגוסט,‏ 2014,‏ 10:53pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/36 "2014-08-21T22:53:37Z")

</div>

I just amended it so we only hijack CTRL-F on topic pages, so this should no longer be a major issue.

---

<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: [22 באוגוסט,‏ 2014,‏ 11:15am UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/37 "2014-08-22T11:15:09Z")

</div>

I am sure plenty of jimmies will be rustled by having it on the topic page alone.

 ![14f](https://global.discourse-cdn.com/meta/original/4X/d/b/b/dbbd3bb91641407e7776485ac864b8298c137f7f.jpeg)

---

<div class="post-metadata">

### Author: ![ntauthority](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ntauthority/32/484750_2.png) [@ntauthority](https://meta.discourse.org/u/ntauthority)
#### Post date: [22 באוגוסט,‏ 2014,‏ 11:41am UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/38 "2014-08-22T11:41:41Z")

</div>

… just when I got used to Ctrl+F actually finding topics on the other pages.

Then again, that’s just me, so _don’t worry about it_.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [22 באוגוסט,‏ 2014,‏ 11:44am UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/39 "2014-08-22T11:44:32Z")

</div>

The actual shortcut “/” still behaves in that manner, so you can still use it.

---

<div class="post-metadata">

### Author: ![TechnoBear](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/technobear/32/40546_2.png) [@TechnoBear](https://meta.discourse.org/u/TechnoBear)
#### Post date: [22 באוגוסט,‏ 2014,‏ 1:46pm UTC](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/40 "2014-08-22T13:46:47Z")

</div>

> [@codinghorror](#):
>
> Press CTRL+F twice to get the browser native search. Warning: results can be bad on topic pages because stuff is unloaded from the browser DOM as you scroll.

If that’s a reply to my post, you’re missing the point. I was simply asking that the shortcut menu be amended to indicate that Ctrl+F will open the Discourse search from within a topic, to save the confusion folk like myself experience when things don’t work as expected.

[Previous page](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875.md?page=1)

[Next page](https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875.md?page=3)
