scroll-into-view / scroll-into-view-if-needed

Element.scrollIntoView ponyfills for things like "if-needed" and "smooth"

Home Page:https://scroll-into-view.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Horizontal RTL scrolling goes wrong way

betaorbust opened this issue · 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!

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).

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

commented

any update?

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

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

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