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 navigation appear next to menu rather than scroll #3270
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3270 +/- ##
==========================================
+ Coverage 82.10% 82.27% +0.17%
==========================================
Files 320 320
Lines 21131 21181 +50
Branches 3196 3196
==========================================
+ Hits 17349 17427 +78
+ Misses 2739 2712 -27
+ Partials 1043 1042 -1
Continue to review full report at Codecov.
|
e24aba6
to
682486e
Compare
682486e
to
07dc51a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lovely!
A few comments. The ones about images, I can sort next week.
web/cobrands/sass/_base.scss
Outdated
right: 0; | ||
background-color: rgba(0, 0, 0, 0.4); | ||
} | ||
|
||
// The nav list has this sort of "full width" look, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we change the left: 1em; right: 1em;
below to left: 0; right: 0;
then we can remove the margin: 0 -1em;
and this comment too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would mean we could also drop a margin: 0
from the #main-nav
ruleset in _layout.scss
too.
34fa3f5
to
67510c4
Compare
Have seen a situation (more likely with upgraded jQuery?) where the test code runs before the map has initialised its layers, so make sure the map is loaded. And make sure a couple of other things load before clicks/submissions.
References to these two files were removed in 44c97f3 but the files weren’t removed at the same time.
Duplicate in front page JS as that does not load the main file.
Improve keyboard accessibility by having it next to the opener, which uses a label and hidden checkbox to work without JavaScript.
67510c4
to
289f38d
Compare
289f38d
to
8af2a30
Compare
Added skip to content link if you could check that over, then I think this might be ready to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍
I am totally at a loss as to when this bug was introduced, or what caused it. The stacking clearly worked fine when the new JavaScript- powered pop-over menu was added 12 months ago (in a01e927), so something must have changed, in core, since then. I think the absolute positions of everything on the map page have always been relative to the viewport (rather than there being any `position: relative` parents). If so, it can’t be that a positioned parent has been removed, causing the `z-indexes` to no longer be in the right stacking context. The `z-index: 1` for `.map-fullscreen #map_box` was set 5 years ago (https://github.com/mysociety/fixmystreet/blame/master/web/cobrands/sass/_base.scss#L2171) in a5ef113, with a comment: `// stack above positioned elements later on the page (eg: .report-list-filters)`. The `z-index: 1` for `#main-nav` was set 12 months ago (https://github.com/mysociety/fixmystreet/blame/master/web/cobrands/sass/_base.scss#L784) in 1784886 (part of the same pop-over menu pull request #3270) and it even has an inline comment saying `// So appears over map`! Anyway, unless someone else can find what changed in the meantime, I’ve done the most obvious thing necessary, which is to define higher z-indexes for the `#js-menu-open-modal` and `#main-nav`. Fixes #3617
Lets you scroll it if the window is short:
Some aside commits to tidy some things up so I don't have to change as much; then one commit that implements it without moving it in the DOM, using JS to make it open/close, then a second commit that moves it in the DOM to right after the button, which I think makes it more keyboard navigable and more sense. Probably also needs a skip to content adding then as well.