vdanyliv / ngx-tiny-slider

Angular wrapper for tiny-slider
https://npmjs.com/package/ngx-tiny-slider
MIT License
15 stars 18 forks source link

ERROR TypeError: Cannot read property 'getBoundingClientRect' of undefined #29

Closed SvenBudak closed 4 years ago

SvenBudak commented 4 years ago

I have a problem in this package. Maybe it is a bug. Open your Sandbox demo: https://codesandbox.io/s/ngx-tiny-slider-wait-for-dom-gvvqh and leave just one image in listOfImages like this:

  public listOfImages: Array<string> = [
    "http://www.mattsorger.com/newsletterpics/gsw07_01.jpg"
  ];

then you will get this error in console:

ERROR TypeError: Cannot read property 'getBoundingClientRect' of undefined

Any idea how we can fix it, that the slider also work if only 1 image is available? :)

vdanyliv commented 4 years ago

@SvenBudak the message that you wrote is thrown by tiny-slider library if you want to use lazy image loading, try to load one instance of the library

vdanyliv commented 4 years ago

@SvenBudak found an issue in the official repo of tiny-slider

https://github.com/ganlanyuan/tiny-slider/issues/545