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
iOS Safari renders blank page #5533
Comments
Even though I can't reproduce, this apparently is a problem with Safari's back-forward cache and not Vue itself. |
Should we close this then? |
I'm sorry but I can not provide a jsfiddle repro so it may take a few more steps to repro. The gist is a minimum complete one. To repro, download the gist and then put it under the root directory of a temporary server like In my device, it is almost a 100% repo. Here is a screencast: It may be a problem with Safari, but we should provide a workaround, should we? |
I think this is actually because... you are re-fetching the data every time you navigate to home. You should use a store to cache the fetched data. |
I'm afraid not. Maybe I didn't make myself clear but it is really a fatal problem which only repros on iOS Safari. When I navigate back, the page stays blank until interacting with it. The data is loaded and the DOM is constructed. It's more like a browser rendering bug but is there something we can do? |
Cannot reproduce on iOS 10.3.1 using the exact code you provided. |
It's a 100% repro. Scroll the list page(important!) and navigate to detail page and navigate back. I have been working on this for 20 hours at least. |
Your iOS version? |
iOS 10.3.1 along with Wechat 6.5.7 as it switched to WKWebview since 6.5.6. |
You should've mentioned that - Safari is NOT WKWebView. |
Repros on iOS Safari. |
Yes. This is a problem that is 100% reproducible on ios(WeChat, Safari, at least)for my app as well. Vue 2.3.3. |
@Centaur Have you found a workaroud? |
@cherry-geqi I added the following code after the data fetch: this.$nextTick(() => {
window.scrollTo(0, 1)
window.scrollTo(0, 0)
}) At least our test team was satisfied. |
yeah, do you resolve this problem ? @cherry-geqi |
@ppxialetsgo The workaround provided by @Centaur just works. This is obviously not an individual case. I suggest vuejs team pay more attention on this. @yyx990803 @posva |
+1 Exactly the same problem. 100% reproduced on iOS 9/10/11 + wechat(WKwebview)/safari. Can't reproduce in UIWebview of wechat. The above workaround works for us. |
We are considering Vue for our new project but this thread seems very similar to what I am seeing. Our primary users wont be having the latest phones and I see that sample Vue apps simply don't render on IOS (7.1.2) Safari => IPHONE-4. Reproduction: But the equivalent React component does: Please advise. |
i have the same problem |
I have the same problem. |
1 similar comment
I have the same problem. |
It's actually an issue related to Safari instead of Vue, check out this demo which doesn't involve with Vue. |
Great! @javoski 's demo indicates the issue is not related with Vue but Safari. |
@javoski . It says in the web inspector that you have an error as shown in the photo Seems like the "tick" is not read properly |
Hey guys ,I had the same problem.but now I solved my problem. in my case, there are two nested HTML elements. I think it's because this makes the frame render wrong. |
I don't know if I had exactly the same issue, but I had a problem that sounds pretty close to this. The solution for me was to install |
Thanks for your workaround @Centaur !!! |
the same problem happens on react, if the element use '-webkit-overflow-scrolling: touch', it won't be rendered on return in my case. |
so , how to solve the problem finally except scroll method? I also encounter the problem on react... |
|
The issue still exists on Safari iOS 12. @Centaur fix worked, you just have to find the main scrolling element. For my case it was a div inside body element. |
你是sjb? |
vue中可以使用
|
# my problem is…Vue in ios safari , When the right slide back to the In addition: It's not just back to the # how did I solve itAbandon the |
the seam problem i have met |
This happend in a PWA for us, and was caused by using |
In my case, I solved it with |
This is still a problem with mobile iOS in 2023. So it goes. Here's a vanilla JS version for anyone with non-Vue pages.
|
I also face the same issue both on nuxt2 and nuxt3 project. And finally I find below link solution: The solution is simple: Before you navigate to another page, you need to set overflow hidden on your scroll body. and after that, remove the hidden property. The sample code is below: const scrollSection = document.getElementById('YOUR_SRCOLL_SECTION_ID')
scrollSection.style.overflow = 'hidden'
// after page router finish....
scrollSection.style.overflow = '' In below Nuxt3 example, I use beforeEach and afterEach in app.vue file const scrollSection = document.getElementById('SCROLL_SECTION_ID')
useRouter().beforeEach(()=> {
scrollSection.style.overflow = 'hidden'
})
useRouter().afterEach(()=> {
nextTick(()=> {
scrollSection.style.overflow = ''
})
}) A demo is here: |
Version
2.2.6
Reproduction link
https://gist.github.com/cherry-geqi/68b3b83491394851f94d8364ab099a83
Steps to reproduce
What is expected?
A complete list of contents
What is actually happening?
A blank page without contents until you swipe on the page
Reproduces on iOS Safari (tested on iOS 10.3.1).
Works on Chrome for iOS even though it uses the same engine.
The text was updated successfully, but these errors were encountered: