Skip to content

Styles are not updated in time #7707

@Axure

Description

@Axure

Version

2.5.13

Reproduction link

https://github.com/Axure/sticky-scroll-demo

Steps to reproduce

npm run dev

and open http://localhost:8080. Scroll inside the region with black border from top to bottom. You will see another div with black border with "text" inside it.

What is expected?

The text should always be right on the midline of the visible area of the smaller bordered div.

What is actually happening?

The text is sometimes not on the midline, which produces visible "lags".

You can see wrongly rendered frames in the developer tools, e.g.:
photo_2018-02-24_17-07-06

(Note that for clarity I temporarily set a red border for the div of the text.)


An online demo is available at https://axure.github.io/sticky-scroll-demo/.

The effect is achieved by modifying the translateY of the text inside the smaller div on every scroll. It seems that the modified styled is not applied in time, so the a newly scrolled frame is rendered using the old style.

I highly suspect that not only styles, but also other data are not applied in time in possible scenarios.

It is not a problem of the browser, since the raw DOM solution works well:

Angular and React do not suffer from this problem:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions