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

Ensure internals.offset has a default value onLayout #537

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justinmakaila
Copy link

Is it a bugfix ?

Is it a new feature ?

  • No

Describe what you've done:

Ensured that internals.offset has a default value in onLayout. This could be implemented somehow in the initState method, but I'm not familiar enough with what's happening in there.

How to test it ?

Verify that a Swiper component changes it's index appropriately on swipe.

return Object.assign({}, this.state, this.internals)
}

onLayout = (event) => {
const { width, height } = event.nativeEvent.layout
const offset = this.internals.offset = {}
const offset = this.internals.offset = { x: 0, y: 0 }
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should be able to add it to internals var line 228, shouldn't you ?

Copy link
Author

Choose a reason for hiding this comment

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

So I realize I'm... 2 years late; did we fix this? lol

Copy link

Choose a reason for hiding this comment

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

It doesn't work right. Should be so
const offset = this.internals.offset = { x: width, y: height }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants