-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Visibility] (for infinite scroll) not working with ReactJS in Chrome, on MacBook. Works in Safari. #2815
Comments
I narrowed this down to an issue using MeteorJS with ##Semantic UI Infinite scroller 'visibility' bug with Meteor & React-Packages and Chrome desktop browser.
Also, this works fine in a ReactJS app in Chrome without Meteor, it's only when you use So far I've got it 1/2 working in Chrome (but only if do this):
I haven't figured out if there's a meta tag that will fix this when NOT in mobile browser emulation mode. i.e. on regular desktop. |
Since this is specific to |
You may also consider trying Mutation observers do observe changes in DOM, but do not capture changes in layout caused by other things (images without a set width/height for example). |
This issue still occurs even when adding:
Still not firing |
@jlukic I got it working by adding
|
I have another app where my infinite scrolling div is inside a Semantic UI pusher, for a side menu, rendered via React-Router, here I need to set offset > 2 to get it working. It's still whack that I don't have to do this on Safari. Either way I was planning on using an offset anyway for my use case. |
see #2777 as well. w/r/t this specifically being an issue for bottomVisible this might be amplified by jquery/jquery#1724 |
I know that it's been 2 years since the issue was closed, but I still reply in case someone else would need it, just like I did. First of all, the bug is still alive. In some cases, with some HTML structure and CSS styles, onBottomVisible just doesn't fire, or fires only once (with the first load) and fails to do so later. I am using not ReactJS, but Vue.js in Electron. Trying to reverse the changes didn't help, so I began searching for an answer. Setting the offset or changing any other settings, turning height CSS styles off didn't help either. After a quick scroll through semantic.js, I found out that the thing that prevented obBottomVisible from being triggered was, in fact, one line of code. Line in Visibility behaviour definition Line in semantic.js in dist folder For me, the quick fix was to remove
I have yet to test it on more sophisticated examples, but now my infinite scroll works. I am sure that this change causes some issues in other cases, but for basic infinite scroll logic it works. Hope this helps. |
I'm aslo having this issue, using react. After second render it stops firing the event. |
Well, in case the problem is still actual: |
Has anyone found a solid fix for this that works on all browsers? |
visibility (for infinite scroll) is not working in Chrome, on MacBook. Works in Safari. Details of the issue are at this StackOverflow question. Here's a JSfiddle. Try it in Chrome, it only works sometimes, very rarely though in the JSfiddle. In my
ReactJS
app it only works on 1st page load, since the DIV isn't populated yet from the DB it's bottom is visible. But once the DIV is populatedonBottomVisible()
never fires.http://stackoverflow.com/questions/31900202/semantic-ui-reactjs-infinite-scroll-not-calling-onbottomvisible-in-visibilit/31901172?noredirect=1#comment51717923_31901172
JSfiddle: http://jsfiddle.net/2wvfjpy9/9/
ReactJS / JavaScript:
The text was updated successfully, but these errors were encountered: