-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Accept buttons not working on first click #47
Comments
@nlukic97 I tried your suggestion (script at the very top), but still no luck for me. @toonvandenbos Any input on the proposition for "after the event DOMContentLoaded is fired" |
I'm not against the idea of masking the DOM element until the document is fully loaded when JavaScript is enabled since the whole point of this package is to work when JS is not enabled too. If somebody has some time to work on a PR having these constraints in mind, that would be helpful! Thanks :) |
Sure, i’ll start working on it
…On Thu, 8 Aug 2024 at 19:08, Toon Van den Bos ***@***.***> wrote:
I'm not against the idea of masking the DOM element until the document is
fully loaded *when JavaScript is enabled* since the whole point of this
package is to work when JS is not enabled too. If somebody has some time to
work on a PR having these constraints in mind, that would be helpful!
Thanks :)
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANSJ22J7L3UK7YRLGNME3HLZQOQXNAVCNFSM6AAAAABHJSDNKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZWGI4DMOBWGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Same issue with 1.2.3 and 1.2.2 @cookieconsentscripts at the top of the head It is used in more projects they're working. window.LaravelCookieConsent is undefined at the console. In local the head try to loads like this: In .env the APP_URL is http://localhost:8000. In live with correct domain also not working. |
@szotyi41 Is there a version without this issue? |
In our older site it is working in the same way: https://mvs-systems.com/ (1.2.2) Update: |
I have noticed scenarious where clicking on "Accept all" or "Accept essentials" will not work (popup box remains open). In such cases, users have to click a second time for the popup box to close.
This issue was the placement of @cookieconsentscripts - if there are other script tags of a larger size above it, the cookie box will open without the actual laravel-cookie-consent javascript being loaded, so clicking on it will throw an undefined error:
The solution is to move @cookieconsentscripts above all other script tags to ensure it loads first.
However, I would suggest displaying the popup box after the event DOMContentLoaded is fired
The text was updated successfully, but these errors were encountered: