How to have Popup between selected and inactive markers in react-leaflet


I’ve been at it for a while now and I just can’t seem to get the Popup between the selected marker (which should be in front. It’s 3 in the image) and the inactive ones.

enter image description here

I’ve tried changing the z-index, but all the markers seem to be in entirely different divs as the popup. Setting the selected marker to absolute doesn’t do anything either.

enter image description here

The only option I think I’m left with is placing a copy of the marker within the popup, but this makes my skin crawl :(.