tiny-swiper icon indicating copy to clipboard operation
tiny-swiper copied to clipboard

some android phone, element.$el.offsetWidth return 0

Open Jarweb opened this issue 4 years ago • 2 comments

Describe the bug image image

function Measure(options, element) { var $el = element.$el; console.log('viewsize', element) console.log('viewsize', element.$el.offsetWidth) setTimeout(() => { console.log('viewsize setTimeout', element.$el.offsetWidth) }, 1000) var viewSize = options.isHorizontal ? $el.offsetWidth: $el.offsetHeight; var slideSize = (viewSize - Math.ceil(options.slidesPerView - 1) * options.spaceBetween) / options.slidesPerView; var boxSize = slideSize + options.spaceBetween; return { boxSize: boxSize, viewSize: viewSize, slideSize: slideSize }; }

swiper init in react useLayoutEffect

Expected behavior

Information

  • Tiny-Swiper Version: [e.g. v2.0.0]
  • OS: [e.g. android]
  • Browser: -
  • Reproduce example:-

Jarweb avatar Jan 13 '21 12:01 Jarweb

@Jarweb Hi, Would you mind create a repo or demo to reproduce this issue?

You can use https://stackblitz.com/ , just paste demo link on this comments

joe223 avatar Jan 13 '21 16:01 joe223

@Jarweb Can you confirm this is still an issue?

a-kud avatar Sep 13 '23 00:09 a-kud