Skip to content

Conversation

malangfox
Copy link
Contributor

@malangfox malangfox commented Apr 10, 2025

Issue

#910

Detail

Fixed being moved to the wrong Panel in the align:“prev” option when using moveType:“snap”.

Demo reproducing the issue
Demo resolving the issue

_findAdjacentAnchor, called from inside the SnapControl, was used to move the current Panel to one of the previous/next Panels when based on the Anchor inside the current Camera area that would have been dragged above the threshold value in a particular Panel.
However, if _findAdjacentAnjacentAnchor was called when the Anchor inside the current Camera was already the previous/next Panel, it would move to the next Panel in the next Panel and move to the next Panel twice.

To prevent this from happening, we changed the conditions under which _findAdjacentAnjacentAnchor is called.
We added logic to the conditional statement entering _findAdjacentAnchor that checks if the currently selected Panel's Anchor, activeAnchor, is the same Anchor as anchorAtCamera.
Now _findAdjacentAnchor, which moves to the previous/next Panel of the current Panel, will not be executed when the Anchor in Camera is already the previous/next Panel.

@coveralls
Copy link

Coverage Status

coverage: 82.686% (+0.01%) from 82.673%
when pulling 8473086 on malangfox:fix/snapcontrol-adjacentanchor
into 293da58 on naver:master.

@malangfox malangfox force-pushed the fix/snapcontrol-adjacentanchor branch from 85c0206 to 761fbad Compare May 28, 2025 09:17
@malangfox malangfox force-pushed the fix/snapcontrol-adjacentanchor branch from 761fbad to 184e3a9 Compare May 28, 2025 09:18
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.

2 participants