You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've successfully followed the installation steps for integrating Preline with Laravel. However, I suspect I may have misunderstood its proper usage, especially when dealing with dependent components through JavaScript.
Let's focus on the example of dismissing the Cookie consent. Preline initializes JS and binds it to the element with the ID data-hs-remove-element="#cookies-with-stacked-buttons". This element should be removed from the DOM when someone clicks the X button.
I've included it in my Single Page Application (SPA) as a Blade component under the main layout Blade template for Livewire. After the full page load, I can confirm that the dismiss button effectively removes the cookie consent component. However, if I attempt to navigate without dismissing the cookie component using Livewire, I encounter an issue where the dismiss functionality is not working.
My question now is whether this issue arises because the page re-renders in the DOM, and the cookies-with-stacked-buttons element should reinitialize the JS code from Preline to bind it in the DOM again?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone,
I've successfully followed the installation steps for integrating Preline with Laravel. However, I suspect I may have misunderstood its proper usage, especially when dealing with dependent components through JavaScript.
Let's focus on the example of dismissing the Cookie consent. Preline initializes JS and binds it to the element with the ID data-hs-remove-element="#cookies-with-stacked-buttons". This element should be removed from the DOM when someone clicks the X button.
I've included it in my Single Page Application (SPA) as a Blade component under the main layout Blade template for Livewire. After the full page load, I can confirm that the dismiss button effectively removes the cookie consent component. However, if I attempt to navigate without dismissing the cookie component using Livewire, I encounter an issue where the dismiss functionality is not working.
My question now is whether this issue arises because the page re-renders in the DOM, and the cookies-with-stacked-buttons element should reinitialize the JS code from Preline to bind it in the DOM again?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions