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

Compatibility Fix for Hotwire Rails & Turbo #199

Open
enderwiggens opened this issue Jan 7, 2021 · 1 comment
Open

Compatibility Fix for Hotwire Rails & Turbo #199

enderwiggens opened this issue Jan 7, 2021 · 1 comment

Comments

@enderwiggens
Copy link

enderwiggens commented Jan 7, 2021

It looks like there is a compatibility issue with the new Hotwire Rails / Turbo.js framework and how Filterrific is initialized.

As turbolinks has been expanded and renamed to turbo, the turbolinks:load call is now turbo:load so to have Filterrific initialize you need to use the following in filterrific.js

$(document).on('turbo:load', function() {
  Filterrific.init();
});
@enderwiggens enderwiggens changed the title Compatibility with new Turbo Compatibility with Hotwire Rails & Turbo Jan 7, 2021
@enderwiggens enderwiggens changed the title Compatibility with Hotwire Rails & Turbo Compatibility Fix for Hotwire Rails & Turbo Jan 7, 2021
@btrewern
Copy link

Well this all depends if you are using Turbolinks, Turbo or neither. I think the best way to support these is to remove initialization from the filterrific-jquery.js file and add documentation so that each developer can add Filterrific.init in their own code.

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

No branches or pull requests

2 participants