Header sometimes not sticking to the top of the page


(Dave McClure) #1

Continuing the discussion from The end of Clown Vomit, or, simplified category styles:

I saw this once today too… not sure how to reproduce though…


(cpradio) #2

Not sure, but its happening to me right now :wink:

Not sure what (if anything) I did special… drats. Hard refresh fixed it.


(Sam Saffron) #3

Confirmed here … lets see if I can repro


(Jeff Atwood) #4

Yeah I get this now too, it’s always on navigation to another topic via Suggested Topics. Very odd.

My guess is we have invalid HTML in there somewhere, somehow?


(Dave McClure) #5

Happening on mobile too.


(cpradio) #6

Yes, that may be it. I’ve been trying a dozen things since I originally got it to happen and I forgot that I was primarily browsing from Suggested Topics initially (I surprisingly, don’t do that very often, just when I’m in a hurry).


(Sam Saffron) #7

I just reverted a change with categories that may have been causing it, oddly enough code looks good, but this could be a jQuery bug or something.

Very hard to debug cause I can not get a local repro:

https://github.com/discourse/discourse/commit/d52b0a2458ca1cb19aa1442c0703ff39ee05ff1d

cc @zogstrip


(Mittineague) #8

I did experience the non-sticky header earlier today but whatever you did seems to have fixed it, unless it’s just coincidence. Darn no-repo sporadic bugs are the bane!


(Sam Saffron) #9

It was happening to me quite consistently in production (but not in dev) before I hacked out that code.


(Régis Hanol) #10

Like @sam I could not reproduce locally… I changed the regexp and deployed the change here. Haven’t heard a single complaint since, so I’m guessing it’s working fine now :whale:

https://github.com/discourse/discourse/commit/b003c2b4f3181cd6ff13623117bbdba7caaad847


(Dean Taylor) #11

The reason it didn’t work is because using a \b in a “character class” is a “backspace” and [^\b] is equivalent to saying:

Match any character that is NOT the backspace character (ASCII 8)

Original regex for reference: \bcategory-[^\b]+


(Régis Hanol) #12