Comments (15)
@malchata, here ya go.
Native:
Windows,10, Internet Explorer 11
BrowserStack:
IPHONE X, iOS, v11, Safari
IPHONE 7, iOS, v10, Safari
Windows, 8.1, Firefox 51.0
Windows, 10, Chrome, 50
It seems that the resize event gets trigger on the iOS devices when in landscape mode which loads the image.
Initialization
document.addEventListener("DOMContentLoaded", function () { yall(); });
Public url
http://yall.now.sh/
I hope this helps! :)
from yall.js.
Thank you so much for this, @kalled. I know it was a bit of pain to get this off Codepen, but it makes troubleshooting much easier.
I'm able to repro in Safari on macOS, even. I'll dig around and see what the issue is. This is immensely helpful.
from yall.js.
Hi, @kalled.
I finally managed to get to this, and I think I have a fix. Do you want to try out the latest version in the dist folder to see if it all works? Hoping we can tie this one up.
from yall.js.
Hi, @kalled. Thanks for your note!
I've not observed this behavior on iOS in any browser, either in places I've used it, or in this Codepen example. But I don't doubt that you're having issues. Is this Codepen the only place you're having trouble with it, or are you having issues with it in development at the moment? If possible, please let me know what your platform version is.
from yall.js.
@malchata, thanks for your quick reply.
I have the same problem running the test suite (moving the content to the top) and on two other sites, also running the CodePen example above in regular and debug mode. I have also tried all of the above via BrowserStack with the same result.
Maybe it is just my phone, none of my colleagues seem to have this issue. Actually I just tried the CodePen on my friends phone, running iOS 11.3.1, same as I using and it works.
This is driving my crazy.
from yall.js.
Do you have any accessibility settings enabled on your iPhone that you can think of? It's all I can really think of at this point. :\
from yall.js.
Ah yea, good point. I also thought about the accessibility settings. I've been using the triple-tap zoom hack to toggle the brightness of the device but everything has been turned off. Maybe I should just reset all settings and see what happens (a little bit to scared to do that though :) ).
Running the the example above in debug mode on CodePen via BrowserStack (iOS xxx, Safari, Chrome) will show the problem. In order to test that you need to have account on both sites and also for the Pen to access debug mode. Doing so It's likely to take it all a bit too far. :)
Thanks again.
from yall.js.
@malchata, hello again.
May I ask which event should call the yallBack function when the browser doesn't support Intersection Observer? From what I can see yallBack only gets called when the browser scrollY position is greater 0 via the scroll event. I experience this issue in the following browsers – Chrome, Firefox, IE11 that doesn't support Intersection. Any ideas?
https://codepen.io/kalled/pen/KROYOB?editors=1010
from yall.js.
yallBack
should never be called if IntesectionObserver
is present, because IntersectionObserver
does not rely on events. It simply observes the viewport and handles element detection for us without the need for any event handlers. yallBack
is only used if IntersectionObserver
is not supported.
from yall.js.
Just a quick thought: Try the minified build in the dist
directory in your pen and see if that works. The source is not transpiled to work everywhere, and some language features may not work in the browsers you're testing in. Just a thought.
from yall.js.
Ah sorry, that was what I meant even though I was indistinct. :) If IntersectionObserver is not supported and when one of the following events are triggered: scroll, touchmove, resize and orientationchange – yallBack gets called. From what I can tell none of the above events gets triggered.
I have also tried the minified version yall-2.0.1.min with no luck. Isn't that the version where you added env.acceptedDataAttributes?
acceptedDataAttributes: [
"data-src",
"data-sizes",
"data-media",
"data-srcset"
]
for (let dataAttribute in element.dataset) {
if (env.acceptedDataAttributes.indexOf(dataAttribute) !== -1) {
element.setAttribute(dataAttribute, element.dataset[dataAttribute]);
element.removeAttribute(`data-${dataAttribute}`);
}
}
Does the if statement ever evaluate to true?
from yall.js.
Let's not address env.acceptedDataAttributes
at this time, as I'm not sure it has anything to do with the problem you're having. Let's stick to the 2.0.0 release and see if we can troubleshoot what's going on there.
I am receiving an error in Codepen now in iOS in Browser Stack, but it's not clear if it's due to my code or something that Codepen is doing. I want to fix this issue, but I'm having difficulty understanding where it's originating from, and if we can reliably reproduce it. To take this issue further, please do the following:
- Move your example off of Codepen to another public server.
- Give me the full platform details of the environment you're using in BrowserStack, including OS version, browser and browser version. If you have any accessibility features or helpers enabled, please note them, and disable them to see if the issue resolves.
- Provide any specific error messages you're receiving (if applicable).
- Provide all initialization options you use when you call the library.
- Hit me with the URL of the hosted example.
Let me know when you've done this.
from yall.js.
Actually, getting it off from CodePen to Now is just one command. I should have done that straight away, it would probably have saved me a couple of hours. :)
Let me know if I can help in anyway.
from yall.js.
@malchata, awesome, works like a charm.
And you also fixed the other issue with the acceptedDataAttributes. 👍
Thanks man!
from yall.js.
No worries. Thanks for bearing with me on this.
I need to do broader testing before I do a 2.0.1 release, though. So for now, use the copy in the dist folder with caution, and open new tickets if new bugs come up.
from yall.js.
Related Issues (20)
- 2.3.2 not working with IE11
- Missing files in the 3.1.5 npm install HOT 6
- yall doesn't seem to work on iOS HOT 3
- Google Page Speed still asking to defer offscreen images HOT 5
- Broken loop in yallApplyFn
- Images in slideshow not loading correctly in Safari
- Strange error in the latest 3.1.6 version HOT 2
- yall.js as a fallback for native loading="lazy" HOT 3
- 3.1.7 issue in IE11 (with polyfill) HOT 3
- Would you add extensions/libraries facilitating usage of this library? HOT 1
- Lazy loading <video> (autoplay/GIF-like behavior) HOT 1
- Picture element has its image loaded before the users scrolls to it. HOT 2
- Width / Height for <img> in test files
- how to disable on particular page
- Type error when dataset is undefined.
- Usage with Webpack & Babel, for supporting IE11 / not ES6 browsers? HOT 8
- Yall not working on modal window iframe. HOT 1
- Yall with background image css with loop
- Can't find this file ./dist/yall.mjs
- [Feature Request] Detect when video is no longer on screen and provide hook
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yall.js.