Skip to content

Commit 7116555

Browse files
authored
Fixes the popup tip in an RTL page (#7157)
* Fixes the popup tip in an RTL page * Updatechangelog * Fix missing " * Fix css lint
1 parent 9b36337 commit 7116555

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
## main
22
### ✨ Features and improvements
3-
- _...Add new stuff here..._
43
- Change the return type of `LngLatBounds.toArray()` to use a more precise type ([#7156](https://github.com/maplibre/maplibre-gl-js/pull/7156)) (by [@n4n5](https://github.com/Its-Just-Nans))
54
- Add `anisotropicFilterPitch` map option to set the pitch above which the anisotropic filter is applied to all raster layers, the default of which is 20° ([#7134](https://github.com/maplibre/maplibre-gl-js/issues/7134)) (by [larsmaxfield](https://github.com/larsmaxfield))
5+
- _...Add new stuff here..._
66

77
### 🐞 Bug fixes
8-
- _...Add new stuff here..._
98
- Fix SDF `icon-text-fit` rendering by correctly unpacking packed shader values in `symbol_sdf.vertex.glsl`, with render-test coverage ([#7141](https://github.com/maplibre/maplibre-gl-js/pull/7141), fixes [#6953](https://github.com/maplibre/maplibre-gl-js/issues/6953)) (by [@pcardinal](https://github.com/pcardinal))
109
- Fix correct bounds calculation for GeoJSON with elevation ([#6963](https://github.com/maplibre/maplibre-gl-js/pull/6963)) (by [@simonmnt](https://github.com/simonmnt))
1110
- Fix Firefox "Alpha-premult deprecated for non-DOM uploads" warning ([#7128](https://github.com/maplibre/maplibre-gl-js/pull/7128)) (by [@birkskyum](https://github.com/birkskyum))
1211
- Fix raster tiles rendering with glyph/icon atlas content after WebGL context loss ([#7126](https://github.com/maplibre/maplibre-gl-js/pull/7126)) (by [@birkskyum](https://github.com/birkskyum))
12+
- Fix popup tip in RTL pages ([#7157](https://github.com/maplibre/maplibre-gl-js/pull/7157)) (by [@HarelM](https://github.com/HarelM))
13+
- _...Add new stuff here..._
1314

1415
## 5.18.0
1516

src/css/maplibre-gl.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
637637
flex-direction: row-reverse;
638638
}
639639

640+
640641
.maplibregl-popup-tip {
641642
width: 0;
642643
height: 0;
@@ -657,6 +658,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
657658
border-bottom-color: #fff;
658659
}
659660

661+
660662
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
661663
align-self: flex-end;
662664
border-top: none;
@@ -684,6 +686,7 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
684686
border-top-color: #fff;
685687
}
686688

689+
687690
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
688691
align-self: center;
689692
border-left: none;
@@ -696,6 +699,30 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
696699
border-left-color: #fff;
697700
}
698701

702+
[dir="rtl"] .maplibregl-popup-anchor-left {
703+
flex-direction: row-reverse;
704+
}
705+
706+
[dir="rtl"] .maplibregl-popup-anchor-right {
707+
flex-direction: row;
708+
}
709+
710+
[dir="rtl"] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip {
711+
align-self: flex-end;
712+
}
713+
714+
[dir="rtl"] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
715+
align-self: flex-start;
716+
}
717+
718+
[dir="rtl"] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {
719+
align-self: flex-end;
720+
}
721+
722+
[dir="rtl"] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
723+
align-self: flex-start;
724+
}
725+
699726
.maplibregl-popup-close-button {
700727
position: absolute;
701728
right: 0;

src/ui/popup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ export class Popup extends Evented {
656656
const width = this._container.offsetWidth;
657657
const height = this._container.offsetHeight;
658658
const padding = normalizePadding(this.options.padding);
659-
let anchorComponents;
659+
let anchorComponents: string[];
660660

661661
if (pos.y + offset.bottom.y < height + padding.top) {
662662
anchorComponents = ['top'];

0 commit comments

Comments
 (0)