Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento 2 modal z-index

Is there a way to change the magento2 modal ( & modal overlay ) z-index, using their built in modal widget?

I've read all their docs and I couldn't find a nice way of doing it. But I do really need to increase the z-index...

I would rather change z-index for specific modals, but a global override of all modal widget z-index's would be OK too.

Here is the relevant part of my code ('zIndex' doesn't do anything)

Any ideas..?

var options = {
  type: 'popup',
  clickableOverlay: true,
  zIndex: 9995 
};
var modalPopup = modal(options, $('#modal_id'));
$('#modal_el').click(function() { modalPopup.openModal() });

Cheers! :)

like image 475
00-BBB Avatar asked Sep 13 '25 14:09

00-BBB


1 Answers

Fixed using css!

Set a custom class on the modal and set the z-index on this

var options = {
  ...
  modalClass: 'hi_z_index'
};
like image 64
00-BBB Avatar answered Sep 16 '25 05:09

00-BBB