Fixed RTL: overlays with LTR code does not start from the left


Well-known member
RTL languages:
Overlays that contain LTR code starts from the right side,
which means that if there is scrolling, you will have to scroll all the way to the left for seeing the start of the code.


This is example from the View Changes in templates.

The fix is adding `direction: ltr` to the .overlayScroll , but this should be added only for LTR overlays in order to not mess the real RTL overlays.


XenForo developer
Staff member
This actually comes from the display: table that's added there (to ensure that the color highlighting covers the entire contnet), though what's really weird is that when we take that away, the horizontal scrollbar disappears. Removing direction: ltr recreates the scrollbar.

I don't understand why, though it seems to be consistent in Chrome, FF, and IE.

Chrome also gets totally confused and actually cuts off the left side of the text (when scrolled all the way left).

Forcing the direction on the scroller would workaround it in this case, but it's definitely not a good workaround in all scenarios.


XenForo developer
Staff member
I don't see any way around this but forcing the direction on the scroll element, so I've done that now.

It generally works in most cases, but if there's a case where the context is potentially going to be mixed LTR/RTL, that will probably cause problems.