Turbo87 / leaflet-sidebar

A responsive sidebar for Leaflet maps
http://turbo87.github.io/leaflet-sidebar/examples/
MIT License
489 stars 158 forks source link

No CloseButton in sidebar #51

Closed ykacenelen closed 6 years ago

ykacenelen commented 7 years ago

Hi everyone, First of all, thank you for this useful leaflet-sidebar plugin. I've got into troubles trying to use it with Leaflet@1.2.0 JS and CSS: sidebar appears and toggle/show/hide behaviours work fine but no CloseButton in the top right corner whereas it clearly appears in the HTML code... This makes UX on small devices kinda limited! Debug console returns the "Deprecated include of L.Mixin.Events" info since Leaflet v1.0. I found this Mixin > Evented solution on GitHub : https://github.com/jgravois/esri-leaflet-geocoder/commit/c2b96b60c63a9a880707f59f7b68406860fd57d2 So I commented "includes: L.Mixin.Events," in L.Control.Sidebar.js and added "includes: L.Evented.prototype," instead but it didn't change anything. Any idea? Thanks a lot in advance for your help, Cheers,

adriennn commented 7 years ago

Does the close button appear with leaflet 1.0.3? I'm not having any issues with 1.2.0 and I haven't looked at the L.Mixin deprecation yet. Have you try setting the z-index manually to something higher than the default?

edit: it's not a problem with L.Mixin // L.Evented

ykacenelen commented 7 years ago

Hi @adriennn, Thank you for replying. Yes, I had to set z-index to a minimum of 800 to get the closeButton visible. I can now think of having this plugin used in my app. Thx again.

zedd45 commented 6 years ago

I'm going to close this for now. If others are reporting this, we can evaluate if the z-index is high enough or if we need to raise it. It's a fairly low value (8)

Stacking context does matter, so in theory this should have it's own context from the sidebar's absolute positioning.