yafred / leaflet-responsive-popup

This plugin overrides L.Popup to remove the need to move the map to be able to see the content of the popup.
https://yafred.github.io/leaflet-responsive-popup/
BSD 2-Clause "Simplified" License
90 stars 20 forks source link

Bad popup opening location with rigth to left text direction #8

Closed frodrigo closed 5 years ago

frodrigo commented 5 years ago

With HTML page set with direction: rtl the pop does not open on the right location. It's OK on vanilla leaflet without leaflet-responsive-popup.

On https://jsfiddle.net/Lypco4w8/1/ not the style="direction: rtl;" and click on the marker.

image

yafred commented 5 years ago

Yes, good catch. At first glance, I have no idea why ... needs a bit of brain work.

Do you need rtl on the map itself ? If not, a simple work-around would be to add direction: ltr; to the style of the map

<body style="direction: rtl;">
<div id="map2" style="height:400px; width:400px; margin-bottom: 20px; direction: ltr;"></div>
</body>
frodrigo commented 5 years ago

Yes need it for control, popup content and so on.

I have this as work around, but the popup glitch:

.leaflet-popup {                                                                                                     
  position: relative !important;                                                                                     
}  
yafred commented 5 years ago

I think I fixed it: https://yafred.github.io/leaflet-responsive-popup/open-on-map-tip-rtl Please add following to your page to test it

<link rel="stylesheet" href="https://yafred.github.io/leaflet-responsive-popup/assets/leaflet.responsive.popup.rtl.css" /> I'll promote it if it works for you

frodrigo commented 5 years ago

Works for me, in rtl and ltr. Thank you.

yafred commented 5 years ago

Promoted to 0.5.0