react-image-lightbox
react-image-lightbox copied to clipboard
RTL support
When using this in an RTL website and when the width of the image is larger than the window width, the translate3d
css will position the image incorrectly offscren.
I suggest adding a rtl boolean property to the component to correct calculate the x
argument of translate3d
. Basically it just needs to be multiplied by -1.
Below image show the incorrectly positioned image:
When changing translate3d(-297px, 0px, 0px)
to translate3d(297px, 0px, 0px)
then the image will correctly be centered: