Skip to content
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

Infinite event is not fired since 2.2.2 #111

Closed
rquelen opened this issue Nov 21, 2017 · 15 comments
Closed

Infinite event is not fired since 2.2.2 #111

rquelen opened this issue Nov 21, 2017 · 15 comments

Comments

@rquelen
Copy link
Contributor

rquelen commented Nov 21, 2017

Version

2.2.2

Vue.js version

2.4.2 (with nuxt 1.0.0-rc11)

What is expected?

infinite-loading should fire 'infinite' event as usual

What is actually happening?

the event is not fired anymore since 2.2.2 (working in 2.2.1)

How to reproduce this problem?

Use the component as usual, but the handler is never called:

<no-ssr>
  <InfiniteLoading @infinite="infiniteHandler"></InfiniteLoading>
</no-ssr>
...
methods: {
  infiniteHandler ($state) { console.log('never called') },
},
@PeachScript
Copy link
Owner

Did you used the vue-no-ssr component? I tried it like your code, and it works for me, this is a live demo: https://jsfiddle.net/ksLr54sw/

@rquelen
Copy link
Contributor Author

rquelen commented Nov 22, 2017

Yes we did use vue-no-ssr (from nuxt), and our code worked with 2.2.1 so we rollbacked to this version for the moment.
Your jsfiddle seems to work, but it doesn't use nuxt and is not run in Server Side Rendering.
So maybe the difference comes from here ? I don't know how to make a simple jsfiddle with nuxt...

@filipesarturi
Copy link

Same problem here

@pirmax
Copy link

pirmax commented Nov 26, 2017

Same problem, sometimes, the function isn't fired...

@filipesarturi
Copy link

Here it always happens in version 2.2.2, back to version 2.2.1 works normally.

@PeachScript
Copy link
Owner

@filipesarturi @pirmax did you also used it with nuxt?

@filipesarturi
Copy link

@PeachScript no

@roosht3
Copy link

roosht3 commented Nov 29, 2017

Event is not firing, using plain VueJS

@PeachScript
Copy link
Owner

@filipesarturi @pirmax @roosh-t3 could you reproduce this problem through a live demo like this https://jsfiddle.net/ksLr54sw/ to help me find the reason?

@kitkimwong
Copy link

Same problem, total can't use

@damienbeaufils
Copy link
Contributor

damienbeaufils commented Dec 8, 2017

Hello,

I have the same problem, and I took the time to build my application with each commit between 2.2.1 and 2.2.2 to find which one lead to this issue.

I found that the commit 8b47b2d which fixes #100 is causing the actual bug. It is because when the elm is body, it can pass the first if or the second if (depending on parameters and element style). But not matter which if is ran, when the found element is body, the result should always be window instead of body.

@PeachScript I've made a PR to fix this issue (and I hope keep the other issue #100 fixed too): #115
Infinite loading works fine in my application when running with this PR.

@PeachScript
Copy link
Owner

@damienbeaufils thank you very much to spend time to find the reason! After reading your comment, I think I made a mistake when fix the #100 , before that the program will find the body first, code is here, I think it is the same with your PR, so is the #100 a special situation? Maybe I should recommend the reporter of #100 to use the force-use-infinite-wrapper attribute?

Thanks again!

@damienbeaufils
Copy link
Contributor

@PeachScript I agree that #100 is a special case and should use the force-use-infinite-wrapper instead

@PeachScript
Copy link
Owner

@damienbeaufils I see, I have been released a new version v2.2.3 to fix it, you can try it now, and thanks for your idea and PR :D

@PeachScript
Copy link
Owner

@rquelen @filipesarturi @pirmax @kitkimwong @roosh-t3 hello everyone, you can try the new version v2.2.3 now, if it still not working, please tell me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants