-
Notifications
You must be signed in to change notification settings - Fork 412
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
Responsive extra with Turbolinks and pagy_array #115
Comments
If I open a new empty tab, then go to a pagy url pasted in the address bar, it generates the error. After that if the tab is the same, it works as expected without errors. The fix for this problem is still there untouched, so I suspect that in this particular case of the new tab, it was there even after the fix. Could you check that? |
I just found the problem... thinking about how to refactor it... |
- moved handling of window event listeners into the responsive function - added resize delay to Pagy.responsive
As far as I understand this fix should be in 1.3? I'm still getting errors:
|
I cannot reproduce that. Could you share a repo that produce that error? |
BTW, I assume the javascript served in your page is the last one, not cached somehow... |
The error actually just happens intermittently, but even when the error doesn't show up I still need to trigger a window resize event before the pagination shows up. This seems specific to the responsive pagination. It's definitely not a cache issue as I just cloned it to a different machine. I can't share the repo I'm afraid, I'll have to try to setup a mini rails test project. If you know of any easy way to do this please let me know. |
Just create a new app with a pagy gem and initializer, plus the javascript part. You don't even need a db: you just set the :count in the controller action and render just the Something like: def responsive_test
@pagy, _records = pagy(count: 1000)
end <%== pagy_bootstrap_responsive_nav(@pagy) %> Or whatever responsive flavor you are using... |
OK, no need to create any repo. I think I understood the problem. It depends on how much stuff is in the page. Please try the |
That seems to do the trick. For myself it doesn't really matter how many items I'm rendering (in an isolated case I was simply rendering a list
|
@alec-implicitdesign glad that it finally works. With "stuff in the page" I wasn't referring to the count nor the items per page: I was referring to the elements in the HTML page, or better, how long the page takes to get displayed (not just "loaded"). The I didn't find a better way to ensure that the |
Okay thanks for clarifying. I will have a look at it when I get a moment and see if I can't find a way around a |
Please refer to this. The same error is popping up again now using turbolinks and pagy_array.
It also looks like the code that fixed this issue originally has been removed, so I take it another solution was found?
The text was updated successfully, but these errors were encountered: