Browser-based search fails if scrolled far enough from occurrence

(Florian) #1

It seems that Discourse only uses the Discourse-powered in-topic search if the topic passes the 20 posts mark. Before that, the browser-based search is triggered via Ctrl + F.

If the browser-based search is used, the search phrase is found when the post which contains the search phrase is somewhere near the current scrolling position.

For example in this topic, the search term There isn’t much to learn in RSS is found when searching from beginning, but not from end (but from post 12 it’s found again).

(Jeff Atwood) #2

No repro in mobile safari in iOS, so this is likely browser specific and not our bug.

(Florian) #3

Forgot to mention that I’ve reproduced it with Firefox 62.0.3, Safari 12.0.1 and Chrome 69.0.3497.100.

(Régis Hanol) #4

I can’t repro in any of the latest browsers on Windows. Could be a macOS thing?

(Florian) #5

I can also reproduce it with Firefox 62.0.3 on Windows:

  1. Copy the search phrase mentioned above
  2. Open the linked topic
  3. Search: :white_check_mark:
  4. Scroll to bottom via Discourse topic scrollbar
  5. Search again: :x:

(Régis Hanol) #6

Still can’t reproduce.

(Jeff Atwood) #7

Are you running browser plugins of any kind?

(Penar Musaraj) #8

I can reproduce this on Mac, on latest Safari and Firefox, but not on Chrome.

(Rafael dos Santos Silva) #9

We do change the cloaking thresholds based on the User Agent (Android gets only 10) so I can repro everytime on Android, but never on desktop Firefox 62 on Linux.

Are you using a standard User Agent string?

(Jeff Atwood) #10

I have absolutely no repro for this under Windows 10 in Firefox, Chrome, or Edge.

(Florian) #11

No plugins, except for 1Password on macOS, but none on Windows (where I can also repro on Edge).

It worked one time on Chrome for me too, but now I can always reproduce if I scroll to the bottom.

Yes, everything standard here. No customizations of any kind are enabled.

(Daniel Hollas) #12

I can actually repro this on latest Firefox on Linux Mint. Super weird.

(Florian) #13

Here is a short video that exemplifies the issue.

(cpradio) #14

Oh, you are actually talking browser search, not the search icon in Discourse, yeah that will happen. As posts are removed from the DOM if you scroll far enough, to ensure you are searching the topic, you have to use the Discourse search.

(Rafael dos Santos Silva) #15

But the topic in question has less than 20 posts, so it never cloaks on Desktop.

(Florian) #16

In my understanding, Discourse hijacks the Ctrl + F keyboard shortcut to show the Discourse-based search if the topic has enough posts for this to happen.


Is it different based manually scrolling vs clicking the Discourse-generated scroll bar?

(Florian) #18

It’s not different for me. The main thing that seems to trigger the behaviour is to scroll to the bottom of the topic — far enoughTM from the original search hit.