Hello!
I have slider with this options
var options = {
infinite: false,
variableWidth: true,
centerMode: true
}
When i swipe last slide to left or first slide to right, the slider throw error Cannot read property 'offsetWidth' of undefined; in getTrackLeft
+1
+1
+1
Same here, it also occurs without infinite mode enabled, with just center mode.
Might want to give https://github.com/godaddy/react-img-carousel a try
@akiran - Has there been any movement on this? I'm experiencing a similar issue with variableWidth = true and setting an initialSlide. Namely, the initial slide isn't brought into frame. Forcing an update after the component mounts makes it a little better, but the initial slide is still a little bit off.
It seems like you closed #325 which describes my issue, marking it as a duplicate of this.
Similar issues have been fixed in previous releases, please try the latest version. If the issue still persists for you, please create a codesandbox demo and reopen it.
Unfortunately this issue still exists:
https://codesandbox.io/s/7m0qow8l9j
The referenced commit should do it.
Most helpful comment
@akiran - Has there been any movement on this? I'm experiencing a similar issue with variableWidth = true and setting an initialSlide. Namely, the initial slide isn't brought into frame. Forcing an update after the component mounts makes it a little better, but the initial slide is still a little bit off.
It seems like you closed #325 which describes my issue, marking it as a duplicate of this.