Skip to content
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

Merged
merged 6 commits into from Jan 15, 2021

Conversation

dracos
Copy link
Member

@dracos dracos commented Dec 14, 2020

image

Lets you scroll it if the window is short:
image

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.

@dracos dracos requested a review from zarino December 14, 2020 17:12
@codecov
Copy link

codecov bot commented Dec 14, 2020

Codecov Report

Merging #3270 (2df46f6) into master (75765f3) will increase coverage by 0.17%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
web/cobrands/fixmystreet/fixmystreet.js 70.69% <87.50%> (+0.77%) ⬆️
web/js/front.js 82.75% <87.50%> (+5.83%) ⬆️
perllib/FixMyStreet/Cobrand/UKCouncils.pm 90.87% <0.00%> (+0.41%) ⬆️
web/cobrands/buckinghamshire/assets.js 93.44% <0.00%> (+1.63%) ⬆️
web/cobrands/fixmystreet/offline.js 45.02% <0.00%> (+13.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75765f3...8af2a30. Read the comment docs.

@dracos dracos force-pushed the mobile-internal-nav branch 6 times, most recently from e24aba6 to 682486e Compare December 17, 2020 13:38
Copy link
Member

@zarino zarino left a 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 Show resolved Hide resolved
web/cobrands/sass/_base.scss Outdated Show resolved Hide resolved
right: 0;
background-color: rgba(0, 0, 0, 0.4);
}

// The nav list has this sort of "full width" look,
Copy link
Member

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.

Copy link
Member

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.

dracos and others added 5 commits January 14, 2021 17:44
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.
@dracos
Copy link
Member Author

dracos commented Jan 14, 2021

Added skip to content link if you could check that over, then I think this might be ready to go.

Copy link
Member

@zarino zarino left a 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! 👍

@dracos dracos merged commit 8af2a30 into master Jan 15, 2021
zarino added a commit that referenced this pull request Nov 29, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants