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
Click event is not working #33
Comments
@blackroostercouk Can you share those with us? if possible. We're also having the same issues. |
sure, you can find Wishlist.js below. const LOCAL_STORAGE_WISHLIST_KEY = 'shopify-wishlist'; const selectors = { document.addEventListener('DOMContentLoaded', () => { initGrid(); document.addEventListener('shopify-wishlist:updated', (event) => { document.addEventListener('shopify-wishlist:init-product-grid', (event) => { document.addEventListener('shopify-wishlist:init-buttons', (event) => { const fetchProductCardHTML = (handle) => { const setupGrid = async (grid) => { const event = new CustomEvent('shopify-wishlist:init-product-grid', { $(document).on('click','.whishlist-btn', function (event){ const initGrid = () => { const getWishlist = () => { const setWishlist = (array) => { const event = new CustomEvent('shopify-wishlist:updated', { return wishlist; const updateWishlist = (handle) => { const wishlistContains = (handle) => { const resetWishlist = () => { $( ".whishlist-btn" ).each(function() { function reloadHearth(){ |
[Shopify Wishlist] Failed to load content for handle |
I think the proper way to handle injected DOM elements would be to use delegated event listeners connected to the document. I'll add an example soon |
Click event is not working after dom bind, this is big issue for predictive search or ajax pagination scripts. I've wrote my own click and foreach event problem solved. Over all really usefull, thank you!
The text was updated successfully, but these errors were encountered: