Overriding Ctrl+F in forums posts

I don’t know if this belongs here, but… overriding the default behavior (Ctrl+F) is always a terrible idea. Even the popup that appears when you press Ctrl+F has it’s height set to auto, so in my browser (Chrome) it’s height turns out to be ~25px effectively, obscuring the view of anything that might be remotely helpful. Overriding default behavior that users expect to work a particular way, is never a good idea.

Hi @Joshua_Burton,

Correct default functionality behavior changes and difficult to find any word normal search also.


I cannot speak to the functionality on whether it can or cannot be controlled as I don’t manage a discourse server… but there are a couple things to note here.

  • Discourse taking ownership of Ctrl+F is a feature of the platform (it may or may not have an option to override this).
  • It only takes focus on Ctrl+F in certain scenarios such as a thread having more than 20 posts
  • Pressing Ctrl+F twice will allow you to use the Browser’s default Find feature
  • The CSS could use some love as it isn’t consistent in the floating



If you are interested you can read more on the reasoning behind it

I personally like the current behaviour

  • Topics/Threads are dynamically loaded as you scroll Native Find feature isn’t helpful (for me) unless I scroll the whole topic before Ctrl+F
  • In smaller Topics Ctrl+F is not captured so you do use of the native Find
  • Pressing Ctrl+F twice is not an annoyance [to me] and there is a message letting users know that they can do so, if they were not aware of it before.
  • Discourse Search/Find acts in a similar way to the native find, gives a list of replies in a topic and when you click on the search result highlights the search term in the topic.
  • As far as I know, this has been the way in Discourse for at least 8 years if not longer, so changing this behaviour of the platform could throw a kink in the gum works for those that expect it to work in such as way.

Side note: I updated the Topic Category from Feedback Other to Feedback Forum

1 Like

Thank you for your feedback @Joshua_Burton
As far as the visual glitches, we will need to fix our customization code.

Here I was going to be too hasty and write pretty much the same thing with the same link to meta.discourse.org forum topic as @codemonkee has already provided, wow

For full context - we had to heavily customize the search component to surface the search box directly rather than forcing the user to do the extra click, but the CSS could indeed use some love again after some further changes in the core of this component done by Discourse since then.

For some reason, double pressing Ctrl+F twice wasn’t working for me yesterday. I’m sure I tried it as I was quite aggravated with something else before this issue, and can see myself continually banging Ctrl+F as I took my frustration out on my keyboard. Even when I inspected the element with the debug tools to increase the height, I never saw the little note to use Ctrl+F twice for the default behavior b/c it’s obscured by yet another element >.<. Double pressing Ctrl+F is working today though. Thanks for pointing that out.

Here’s the link to that exact forum post: How to manipulate a part of string: Split, Trim, Substring, Replace, Remove, Left, Right

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.