lyfeyaj / swipe

Swipe is the most accurate touch slider. Support both React and Angular.

Home Page:https://swipe.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesnt appear if div is hidden

provized opened this issue · comments

I almost wasted hours trying to understand the issue, the problem was the plugin didnt initiate because the element was hidden on second page of one page scroll

Can you provide more information (code examples, with screenshots)?

Is this a bug related to Swipe, or have you fixed your implementation?

The problem is that the swiper computes a width of zero if the div is hidden. IMO the swiper needs to operate and initialize properly even if it's hidden. There are many use cases where something needs to be initialized but not shown right away. One area where this is causing me lots of grief is a slider for mobile that initializes in the responsive desktop mode, but when the browser is resized larger, it doesn't work because everything has been initialized by swipe to 0px