robbyoconnor reported a CSS bug after upgrading Discourse, where a custom global navigation bar overlapped the site header. While cpradio initially suggested the issue stemmed from custom CSS, robbyoconnor shared their stylesheet, which included various UI hacks. cpradio identified the root cause: the docked class was being incorrectly applied to the .d-header, forcing a position: fixed state even at the top of the page. This behavior was traced to recent changes in the site-header.js component, specifically a lack of proper window.pageYOffset checks compared to previous logic. Although robbyoconnor temporarily fixed the overlay by removing position: fixed, cpradio advised against a PR removing it, as the fixed position is intentional for scrolling; the fix should prevent the docked class from applying at the top. Further discussion revealed that the custom header also disappeared on scroll due to position: relative in the CSS, which cpradio explained was expected behavior for that styling choice. robbyoconnor clarified that the overlay issue was unique to the Discourse update, while the disappearing header was a separate, acceptable behavior for their site. The issue was ultimately confirmed as resolved in post 18.
So OpenMRS uses a global navigation bar and I upgraded to the latest c3ceb6ef7d0886a0165df5354042c6588ac4b7e5 and noticed that our globalnav bar covers the our header, see below:
I don’t think you want to do that PR, the position:fixed is intential for when you are scrolling down the topic list/reading a topic. Without it, the header will scroll out of view. What needs to happen is it shouldn’t apply docked when you are at the very top.
Yes, if you view the examineDockHeader at this point
And compare it to dockCheck at
You will see it doesn’t seem to be utilizing the window.pageYOffset check and the $('html').scrollTop() check anymore. That seems to be the cause to applying the docked class inappropriately (if I had to venture a guess).
Yeah, the docked class thing is definitely a bug, the disappearing on scroll… well, that is due to the custom CSS using position: relative on your header, that will definitely scroll with page scrolling. You’d have to use position:fixed and remove the margin: -27px 0 0 to stop it from scrolling off screen.
Should note that HTG’s header disappears whilst scrolling and his site is before the CSS changes I linked to previously, so that tells me if you want a static header to show all of the time, you have to modify your CSS to make that happen.
So update: The CSS quirk only appears in discourse and it’s recent – all of OpenMRS’ other services show the navbar correctly…so not sure what to do from here…I’m at a loss
I don’t understand. When I visit the main site, scrolling makes that top gray header disappear… It doesn’t remain fixed. Or are you still refering to the docked class, which is definitely a bug related to the timeline changes (so it seems)
I assume you’re talking about this – but yes I am referring to the docked class which causes the navbar to overlay the header…the disappearing when it scrolls is something i don’t really feel like dealing with. It works fine and as we want it…but on discourse, it fails…this is a recent thing when I updated