Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with ScrollTimeline and animating physical vs logical properties when using writing modes #4350

Open
stephenmcgruer opened this issue Oct 18, 2018 · 2 comments

Comments

@stephenmcgruer
Copy link
Contributor

This is somewhat of a meta-issue about animations, but it is one that is clearly exposed if ScrollTimeline becomes a standard. The issue is that many CSS properties, most predominantly transform, are physical based but ScrollTimelines are logical (possibly; see WICG/scroll-animations#22).

Consider a ScrollTimeline driving a translateX(..) animation:

const timeline = new ScrollTimeline({ scrollSource: scroller, orientation:  'inline' });
const effect = new KeyframeEffect(target, { transform: [ 'translateX(0)', 'translateX(100%)' ] }, 1000);
const animation = new Animation(timeline, effect);
animation.play();

In a direction: ltr scroller, this works as intended - the target moves left-to-right as you scroll left-to-right. But in a direction: rtl scroller, the target moves left-to-right as you scroll right-to-left :(

As noted, this is a meta issue in that it's not immediately solvable by a ScrollTimeline spec. I'm mostly filing it so we are aware of the issue and can discuss it. One approach that may work is just to push on some form of logical transform ability, e.g. adding transform: translateLogical(..) or similar.

@dontcallmedom dontcallmedom transferred this issue from WICG/scroll-animations Sep 19, 2019
@majido majido added the scroll-animations-1 Current Work label Sep 19, 2019
@flackr flackr added css-transforms-2 and removed scroll-animations-1 Current Work labels Aug 9, 2022
@flackr
Copy link
Contributor

flackr commented Aug 9, 2022

This seems like more of a request for logical transform functions than any change to scroll linked animations.

@MurhafSousli
Copy link

MurhafSousli commented Feb 6, 2024

I confirm the bug, moving custom horizontal scrollbar thumb using translateX works fine in LTR, but in RTL the logical position goes in the opposite direction

image

however, when I animate right property with position: absolute to move the thumb, it works fine in RTL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants