[openstreetmap/openstreetmap-website] Use Bootstrap utilities to set z-indexes of map ui and fix some bugs (PR #4686)
Anton Khorev
notifications at github.com
Fri Apr 12 14:20:09 UTC 2024
## bug 1
Open the right sidebar, then open a dropdown menu ("more" or user menu):

Seems to work fine. Now make the screen smaller. If you get the intermediate width like in #4675, the dropdown menu will be covered by the sidebar:

Bootstrap sets z-index to 1000 on dropdowns which should be high enough, but we use even higher z-indexes on map ui elements. We do this to keep them above Leaflet's range of z-indexes. What we could do instead and what this PR does is to isolate Leaflet in its own [stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context). Here I set the entire map at z-0 with a Bootstrap utility class. The right sidebar gets z-2 to stay above the floating left sidebar, which gets z-1.

## bug 2
Open the right sidebar on a small screen then try to open the menu:

The menu is a part of the header, with z-index below the right sidebar. In addition to the fixes above I set the header at z-3:

You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/4686
-- Commit Summary --
* Put map in its own stacking context
* Use Bootstrap to set z-indexes of map-overlapping ui
-- File Changes --
M app/assets/stylesheets/common.scss (3)
M app/views/layouts/_header.html.erb (2)
M app/views/layouts/map.html.erb (6)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/4686.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4686.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4686
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4686 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240412/ed79021f/attachment.htm>
More information about the rails-dev
mailing list