Modal form created from nav bar menu appears behind menu

Created on 5 February 2022, over 2 years ago
Updated 30 October 2023, 8 months ago

Problem/Motivation

When a menu item creates a modal (popup) form, the form is displayed with a z-index behind that of the navbar's menu. On a phone, this may mean that the modal form cannot be use because it is obscured by the menu.

Steps to reproduce

1. Create a fixed navbar with a menu which displays a popup modal form.
2. Narrow the window so that the nav bar displays using the hamburger menu icon.
3. Open the menu and chose the menu item to display the modal form.
4. Note that the modal form is displayed behind the navbar.

This seems to be because the z-index values used by bootstrap are in above 1000. In _variable.scss contains:

$zindex-navbar: 1000 !default;
$zindex-dropdown: 1000 !default;
$zindex-popover: 1060 !default;
$zindex-tooltip: 1070 !default;
$zindex-navbar-fixed: 1030 !default;
$zindex-modal-background: 1040 !default;
$zindex-modal: 1050 !default;

However the modal form is created (via the jqueryui bridge, I believe), using a starting z-index of 100.

Proposed resolution

I mitigated this by redefining the bootstrap z-index values to be less than 100 in my subtheme. Or perhaps they should be defined so that 1040 becomes 100. Not sure. Hope this helps someone else.

๐Ÿ› Bug report
Status

Closed: won't fix

Version

4.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States DanChadwick

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024