Command-F being overridden

Discourse apparently overrides cmd-f. So I cannot use cmd-f to find text on a page. Instead I get redirected to use the search already indicated by the magnifying glass at the top right. Can this cmd-f override be shut off?

Turns out that itā€™s a complex topic. The workaround to to press Command-F-F to get the in-page search.

The problem is that the standard in-page search may not work in Discourse in longer topics because not all the text may be available for searching.

1 Like

Or manually mouse to the menu and hit it there. Although that takes forever in comparison.

Personally, I find things that override fundamental functionality of a Mac (like cmd-f or cmd-c) to be just annoying, no matter how good the intention. I could always use the search box if thatā€™s what I really wanted. If I donā€™t chose to, itā€™s most likely because I donā€™t want to.

1 Like

Right! Edit > Find > Find also works, but is annoying.

I can see their logic, but I agree with you about overriding default behaviors being a bad thing.

Personally I think itā€™s a very sensible default when they know that much of the content on the page wonā€™t actually be searched by doing the default search.

1 Like

Itā€™s sensible in the case where somebody just opens the page, does no scrolling, and then wants to search.

Itā€™s not sensible when a reader has read through a thread, scrolled all the way to the bottom while doing so, and then wants to search. For example, let me jump back up to the post by Adam. In such a case itā€˜s just duplicating already existing functionality at the expense of breaking expected default behavior on any Mac.

That may be ok for some, it isnā€™t for others. Thatā€™s why IMHO there should be a user option. That option could actually point out why in one case you wouldnā€™t want to use standard Mac search.

Well, itā€™s worth noting that, in my brief testing on Safari, it only overrides the browser search function if the original page-load didnā€™t include all the posts in the topic.

If Iā€™m right, then perhaps that functionality could be extended to also stop overriding when all of the posts have been scrolled through, and are thus displaying on the page. You could file a request on meta.discourse.org to get that done. It would make sense.

Regardless, I think itā€™s important to not default to the browser search when all of the pageā€™s content isnā€™t going to be searched if the default browser search is used. I canā€™t tell you how many times Iā€™ve been burned by that on all kinds of websites. Often you have to click to open section after section after section, click ā€œmoreā€ and ā€œmoreā€ and ā€œmore,ā€ or scroll and scroll and scroll before you can click Command-F and have it actually search all the content on the page. And if you accidentally miss one of the sections on the page, then you think youā€™ve confirmed that something isnā€™t present, when in reality itā€™s still just hidden. And itā€™s even worse if you didnā€™t even know that there was unloaded page content.

1 Like

I do not see this behavior in Safari. I get the Safari search when I hit āŒ˜-F.

In Safari, I get the Discourse-native search when the topic has enough comments for them to not all be loaded from the beginning (e.g. the Apple pushing OS updates topic). This Command-F topic is not yet long enough to trigger the change.

Ah, yes. That is very annoying. I bet I can ā€˜fixā€™ thatā€¦

After doing some research, this appears to be something that has been brought up to the discourse devs several times, and they insist that they are right. They have made changes which, to my mind, have made the feature even more annoying since it adds a level of mystery to what will happen if you hit āŒ˜-F. If the thread has less than 20 messages, then the common is not intercepted, otherwise it is.

So, spin the wheel and see what happens, because no way will you know ahead of time what youā€™re going to get.

Short of having a plugin that intercepts the code and removes the objectionable part, it is impossible to disable and the developers refuse to consider having an option to turn it off. They haveā€¦ reasons, which I am sure are sensible to them, but their attitude from what Iā€™ve read is ā€œUsers? Yeah, users are wrong and weā€™re going to do our thing regardless of how it messes up peopleā€™s experience.ā€

The first few times it happened to me it was irritating, but after that I realized how important it is. Perhaps you didnā€™t read my comment where I explained why itā€™s user-unfriendly to do it any other way.

Even in this case, Discourseā€™s behaviour makes sense, as it only keeps ~20 posts loaded. So even if youā€™ve read through the whole thread, if itā€™s a long one the earlier posts will no longer be searchable with the built-in search. In the case of short threads where all posts are loaded, Discourse doesnā€™t override cmd-F. If you read the thread Adam linked to, it explains how the feature works.

The summary is that Discourse only overrides cmd-F when itā€™s necessary to ensure youā€™re searching the whole thread.

1 Like

If you really donā€™t like this overriding of Command-F and you use Safari, thereā€™s an extension that @tommy found that will stop it:

2 Likes