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

fix: strict movetype moving wrong panel on circular flicking #842

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

malangfox
Copy link
Contributor

@malangfox malangfox commented Nov 30, 2023

Issue

#841

Details

ezgif com-video-to-gif (2)

When using the next Panel to move in moveType: strict, we use the following rules

  1. find the anchorAtPosition that is closest to the point the camera is currently showing.
  2. if anchorAtPosition is not the same as Flicking's current Panel, we move to anchorAtPosition.
  3. if anchorAtPosition is the same as Flicking's current Panel, navigate to adjacentAnchor which is the next/prev anchor of anchorAtPosition.

However, there is an exception to this rule that can cause an error when you rotate the circular Flicking once before the event that updates the current panel is fired,

If you rotate the Flicking once, you'll end up in a situation where the camera is showing the position of the current panel again.

If that happens, you won't be able to stop on that panel by step 3 and you'll move to the next Anchor.
This will cause the error described in the issue.

In this PR, I have fixed moveType: strict to continuously update the current Panel based on the willChange event to prevent the above exception from occurring.

@coveralls
Copy link

Coverage Status

coverage: 82.638% (-0.001%) from 82.639%
when pulling 044b725 on malangfox:fix-circular-strict-panels
into 346c43a on naver:master.

@malangfox malangfox merged commit e180d97 into naver:master Dec 11, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants