Header sometimes not sticking to the top of the page

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…

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

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

Confirmed here … lets see if I can repro

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?

إعجاب واحد (1)

Happening on mobile too.

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).

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

إعجابَين (2)

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!

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

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

إعجابَين (2)

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]+

إعجابَين (2)