Mapbox-gl-js: Map not displayed at all when <html dir="rtl"> (regression!)

Created on 23 Feb 2020  Â·  3Comments  Â·  Source: mapbox/mapbox-gl-js

mapbox-gl-js version: 1.7 (didn't happen in 1.0)

browser: Chrome 72

Steps to Trigger Behavior

  1. Place map container inside html element with dir="rtl", or any other element with dir="rtl" attribute
  2. Map won't even show up.
  3. (This has nothing to do with the RTL plugin and whether it's included or not)
  4. Workaround - wrap the map in div with dir="ltr" to make it work.

Note that this is a regression. It didn't happen in 1.0, and happens in 1.7 (I noticed it when upgrading my RTL app version of mapbox from 1.0 to 1.7)

Link to Demonstration

Go to any demo and wrap the map in html element with dir="rtl"

Expected Behavior

Map will be displayed

Actual Behavior

Map isn't displayed at all

bug release blocker

All 3 comments

Confirmed — thanks for the report! Regressed by https://github.com/mapbox/mapbox-gl-js/pull/8227 — making a fix now.

@mourner Thank you so much for your prompt response and fix! Looking forward to the next release!
Also, if I may ask, out of curiosity -- what steps did you take to locate the exact change that caused the issue?

@yarinr thank you! I had a hunch that this is a CSS-related bug, so I set up a simple test case with dir=rtl and started testing the same JS build against different versions of CSS, and found that v1.1.0 already has the bug. Next, I skimmed through the v1.1.0 changelog for any CSS-related pull requests, and immediately found the text-align: left one which seemed suspicious. Then I confirmed that this line triggers the bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rasagy picture rasagy  Â·  3Comments

aderaaij picture aderaaij  Â·  3Comments

BernhardRode picture BernhardRode  Â·  3Comments

stevage picture stevage  Â·  3Comments

infacq picture infacq  Â·  3Comments