-
Notifications
You must be signed in to change notification settings - Fork 260
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
Make the scoreboard summary sticky #2132
Conversation
In general I like it on my large screen. If I shrink it to mobile view with Chrome developer tools it is appearing some time in the middle of scrolling down the scoreboard though - not sure if this is also happening on real devices. Also I wonder whether we can somehow visually indicate in a nice way that there is more stuff behind the sticky part? |
That could be desired behaviour, we have a summary per sortorder so it should stick keep with its part of the table. Another sticky part should than come up for the next sortorder though.
I think technically I can with CSS indicate that, the only question is how. |
I only had one sortorder and had to scroll down ~1 screen to make the sticky part appear. |
Than I'll investigate, the PR was only as a quick demo if we would want this. |
1994958
to
d97e4dc
Compare
https://codepen.io/TomAnthony/pen/qBqgErK is the best thing, https://stackoverflow.com/a/25312347 explains why this is very hard to achieve. |
Checking on my android the header row is also not sticky, I assume you're on android also? The easiest fix would be to not apply this specific styling on phones. |
I didn't try it on an actual phone but with the device toolbar of the chrome dev extensions. |
cca5940
to
469525b
Compare
Verified on phone (FF+Android) and it seems to work, works on an older iPhone. If approved I'll squash this. |
In Chrome / Desktop it does work. In Chrome / Desktop with developer tools set to mobile devices it doesn't work (regardless of the device). In Firefox / Desktop it doesn't work either for me. In Firefox / Desktop with developer tools it also doesn't work. |
bf8c13e
to
8b71fc8
Compare
I can't reproduce this. My PR doesn't add anything for phones/small screens as there the sticky header also doesn't work (and is left for a future PR). For me it works in chromium & firefox (both on desktop). |
d63f1ad
to
87e591b
Compare
This bundles some of the inlince CSS and adds a z-index per sortorder to make the sliding natural. In case of the same z-index the order of creation in the DOM is picked as how to stack. Given that creating the DOM from bottom to top is unmaintable the less worse option is introducing a lot of z-indexes. Perfect solution would be to put this in a class to remove the inline styles but that is left for another time. Unrelated to this PR, it seems in chromium based browser the border/shadow of the sticky elements gets lost. The misalignment of the `tbody` is because we check for the sortorder, when there are multiple we close and open a new one which looks misaligned due to the twig `if` condition.
52f0f1b
to
9af668c
Compare
Before I fully fix the PR I would like to know if we want this.
The reason I like it is that the summary per sortorder is now properly used and when scrolling the scoreboard you get all the relevant information directly.
Current problems still:
display: relative
the background jumps over the border (probably together with the border collapse) so we should use shadows as border & shadow misalign on 1px (a shadow can not fall with at 12 o'clock )