-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Wrong width until page is resized on Firefox #2218
Comments
Can you show how do you initialize Swiper and what options do you use? |
The slider is initialized like this :
Here is the value of
|
Hi ! |
Hello @nolimits4web , We are stuck on this... |
Looks like demo not working for me anymore (no stores located). Have you also tried new v4 Swiper? |
Hi ! No we did not test v4 yet. |
Yes, i'm in Rostov-on-Don, but it doesn't show me anything. Recommend also to check with v4 |
@loriepisicchio, I have the same problem on Chrome. |
@nolimits4web never mind, in my case it was because I was hiding the scrollbar on Chrome using :
The problem is that the value of slideSize & co won't take in consideration the fact that the scrollbar has been hidden. Simple. Hope it can help someone. |
@nolimits4web same problem on Chrome 66 on Mac.
|
Hi there, I was having the same issue only on firefox, I checked the container parent of the swiper with the same crazy width as the swiper, and add width: 100% and fixed it. Hope it works if any one has a similar issue. |
I have the same problem on Chrome. Thanks in advance. |
After several days of trying to solve this annoying bug, found out that the problem was cos of a This might need to be added to the documentation to help others in future |
Same issue on Mac Chrome 71 |
same here with the latest version of swiper, on chrome as well. |
Same issue on all modern browsers |
When are you initializing Swiper? If your page CSS hasn't loaded before initializing Swiper, and your CSS affects the dimensions of your swiper container after it's been initialized your width will likely be incorrect. To verify if this is your issue try waiting for the window load event before initializing Swiper.
It's common to use "The DOMContentLoaded event fires when the initial HTML document has been completely loaded and parsed, |
I just tried doing a window resize in the load event listener. That appears to work for me. I figured it's nicer to do that, rather than wait until everything is loaded before the sliders are loaded. It might make the page appear to load faster this way, though I'm only assuming this.
Note, I used jQuery a bit there. |
Having the same issue on Chrome only v80. I'm currently using version 5.2.1 and tried all of the above workarounds with no fix. Firefox works perfect, but with Chrome I have to resize the window for swiper to be initialized. UPDATE |
Issue also occurring in Safari 13.1.2 when parent element is display:grid. Waiting for window.load does not solve issue. |
Faced that in Chrome, in my case swiper container was a flex child item and had no width set. |
Maybe this is related to #4019, that is the container changes its size after swiper has been initialized. |
Hi, I think I've been struck by this bug. Here the slider is inside a grid item that spans two columns when the viewport width is >= 992px. Note that it only happens in Firefox. |
Hi, |
I wish there was. Owner of the repository is horrible about responding
…On Tue, Jan 26, 2021, 23:55 Premi Jimee ***@***.***> wrote:
Hi,
Is there any update on the above issue? I really need help if anyone could
help me.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2218 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALQZNT256P4DYFQPF4P54G3S37BHVANCNFSM4D4VW7UA>
.
|
Should be fixable with this 5f80052 |
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
Swiper Version: 3.4.2
Platform/Target and Browser Versions: Firefox 55.0.3 (64 bits) on MacOS Sierra 10.12.6 (16G29)
What you did
We use Swiper to show a list of items. We observe a strange behavior on Firefox.
Expected Behavior
On Chrome, it works fine : our swiper is shown with 3 elements.
Actual Behavior
On Firefox, on page load, only one element is displayed and stretched on the whole page width. We need to resize the page to get the right layout.
When inspecting the generated HTML, we can see that the style element on the swiper-slide divs containing width and margin is not set on first load, but is set after resize.
Note that the elements of the slider are loaded asynchronously.
URL to reproduce :
https://support-swiper-demo.dev.v3.aws.lead.fm
Login : leadformance
Pwd : password
Open it in Chrome or Firefox. After a while you should see "Nearest locations" section above "Our Events" section. We have created 3 stores located around Rostov-on-Don so that you should see locations based on your geolocation. Please let me know if you are located elsewhere so that I can create new locations working for you.
Screenshot on Firefox before resize (bug)
https://s3-eu-west-1.amazonaws.com/swiper-demo-screenshots/Capture+d%E2%80%99e%CC%81cran+2017-09-27+a%CC%80+08.38.26.png
Screenshot on Firefox after resize (expected result)
https://s3-eu-west-1.amazonaws.com/swiper-demo-screenshots/Capture+d%E2%80%99e%CC%81cran+2017-09-27+a%CC%80+08.39.37.png
The text was updated successfully, but these errors were encountered: