scroll-into-view-if-needed icon indicating copy to clipboard operation
scroll-into-view-if-needed copied to clipboard

Horizontal RTL scrolling goes wrong way

Open betaorbust opened this issue 3 years ago • 5 comments

I've noticed that scrolling a horizontal group of elements that are in right-to-left (RTL) writing mode scrolls to the wrong end of the list. The native API seems to handle this case, so I believe it's a bug.

Reproduction in this pen. Instructions on the page.

Thanks so much!

betaorbust avatar May 12 '21 19:05 betaorbust

Is this going to be fixed any time soon?

This is breaking libraries which rely on this specific library (e.g. https://github.com/asmyshlyaev177/react-horizontal-scrolling-menu).

choxnox avatar Jul 27 '22 15:07 choxnox

Is this going to be fixed any time soon?

This is breaking libraries which rely on this specific library (e.g. https://github.com/asmyshlyaev177/react-horizontal-scrolling-menu).

My library can work without polyfill, but this polyfill is good, I hope bug with RTL will be fixed.

Can detect RTL on body like this

    const direction = window.getComputedStyle(document.body, null).getPropertyValue('direction');
    

From here https://stackoverflow.com/a/16958416/5538912

asmyshlyaev177 avatar Aug 07 '22 15:08 asmyshlyaev177

any update?

Sovai avatar Mar 27 '23 10:03 Sovai

This library is a life savior, but I too am affected by this and would love it if this bug was addressed 🙏

Tchelet-Levi avatar Oct 04 '23 23:10 Tchelet-Levi

For information, I did a PR a few months back to add support for RTL in the base library (PR here: https://github.com/scroll-into-view/compute-scroll-into-view/pull/907)

I am still waiting for it to be merged but I did not receive answer from the maintainers yet.

bakura10 avatar Nov 30 '23 01:11 bakura10