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

[WIP] Reordering in react-flip-move causes effects on MUVs #3

Open
albinotonnina opened this issue Apr 12, 2018 · 2 comments
Open

[WIP] Reordering in react-flip-move causes effects on MUVs #3

albinotonnina opened this issue Apr 12, 2018 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@albinotonnina
Copy link
Owner

Such as resetting scroll positions inside MUVs.
cause: https://github.com/joshwcomeau/react-flip-move/blob/master/src/FlipMove.js#L313-L326

@albinotonnina albinotonnina added bug Something isn't working help wanted Extra attention is needed labels Apr 12, 2018
@albinotonnina
Copy link
Owner Author

Needs to work on this.
Current Hacky fix is here:
https://github.com/albinotonnina/react-flip-move/blob/push_not_splice/src/FlipMove.js#L332-L344

@albinotonnina
Copy link
Owner Author

albinotonnina commented Apr 12, 2018

Also prepare a demo to reproduce the issue, which is:
MUVs with scrolling content get a scroll reset when navigating back to the root MUV, reason is the order of the children react-flip-move returns from the calculateNextSetOfChildren method.

Eg:

From: MUVs 2,3
To: MUVs 1,2

RFP needs to keep MUV 3 until the animation ends so it's more like this:

From: MUVs 2,3
MUVs 1,2,3
To: MUVs 1,2

Although react-flip-move order them like this:
From: MUVs 2,3
MUVs 1,3,2
To: MUVs 1,2

Hence the browser reset the scroll positions as an effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant