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

send correct props when calculating gallery position #1290

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

Galpittel
Copy link
Collaborator

When UNSAFE_componentWillReceiveProps in it's inner function we are calculating gallery position according to the old props (happens before props are changing).

@@ -1114,7 +1114,7 @@ class SlideshowView extends React.Component {
GALLERY_CONSTS[optionsMap.behaviourParams.gallery.layoutDirection].RIGHT_TO_LEFT;
const { hideLeftArrow, hideRightArrow } = this.state;

const isScrollStart = this.isScrollStart();
const isScrollStart = this.isScrollStart(props);
const isFirstItem = this.isFirstItem();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe cover also this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're checking if this.state.activeIndex === 0, no props needed.

@Galpittel Galpittel merged commit 090c39a into master Sep 19, 2024
8 checks passed
@Galpittel Galpittel deleted the set-correct-props branch September 19, 2024 08:14
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