-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tabs don't reappear when default font-size is smaller than 16px #1114
Comments
I cannot reproduce this problem on Firefox 67, macOS. I tried setting the font size to Also - did you scroll entirely to the top? There's a |
I'll try to reproduce this on Windows somehow. I don't have a machine for macOS.
I believe this is related to fonts / font-sizes, where minor changes probably affect the item placement or coordinates. So it will work with some fonts / font-sizes at some zoom levels, but not on others. I believe that because fonts can have slightly different shapes / sizes on different platforms.
No.
Yes. See the linked screenshots in downstream: when loading the page, the tabs are still there, scrolling down and back up hides them. Anything else is at exactly the same position as before - it's fully scrolled up. I also checked
No. I'm using a newly created Firefox profile to reproduce this issue. I'm only changing the |
Well, this sounds like a strange edge case with your setup/environment. The tabs feature was implemented more than 2 years ago, so I would have expected that if this strange behavior was more common, somebody would've opened an issue by now. The next step you can do is try to debug the JavaScript. In order to do this, follow the steps to set up a build process. The line in question is here:
As an easy quick fix you could override the I always wanted to refactor the whole JavaScript code to a more reactive architecture using RxJS and TypeScript, but my time is too limited right now and the JavaScript code has proven to be surprisingly stable. |
A friend reproduced this on Windows Firefox with font size 11.
I believe we've had a complaint for this before, where a user was unable to find certain aspects of the website. The problem is also that most people probably assume bugs in their own code (as did I), or simply don't create upstream bug reports - especially if the bug affects a small number of users, who might not be willing to report bugs for a small website they use (which they do not own). I've looked into this now using
The The current code in master does: Said friend who reproduced it, also prototyped a fix (that did not work); I've turned it into a working hack: /**
* Update visibility
*/
update() {
const c = this.el_.children[0]
const rect = Array.from(c.getClientRects())[0]
const active = window.pageYOffset >=
c.offsetTop + (5 - rect.height) // TODO: quick hack to enable same handling for hero
if (active !== this.active_)
this.el_.dataset.mdState = (this.active_ = active) ? "hidden" : ""
} The code in this code will change the calculation to However, I believe this code is still a dirty hack, because it assumes that I did also consider I'm not sure how to PR this code: my Also I've never really written any serious javascript and would rather have someone else integrate a solution upstream. |
Thanks for your thorough research! As you discovered, the hardcoded value of One drawback of your approach is that you call |
Fixed in 9d1390f |
Released as part of 4.4.0. |
Description
Top menu (navigation tabs) never reappears after scrolling down.
Expected behavior
Actual behavior
The tabs remain hidden and non-clickable (expected behavior 2 does not happen).
See discussion in downstream for screenshots: xqemu/xqemu.com#40 (comment)
Steps to reproduce the bug
Steps to reproduce in downstream: xqemu/xqemu.com#40 (comment)
(seems to be related to font-sizes).
Problem does happen at (no top banners / hero teaser):
Problem does not happen at (top banners / hero teaser):
System information / Package versions
The text was updated successfully, but these errors were encountered: