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

Sticky Alerts (Unhandled Rejection (TypeError): Cannot read property 'insertBefore' of undefined) #114

Open
timbogdanov opened this issue Aug 13, 2021 · 1 comment
Labels
v1 Version 1.x.x

Comments

@timbogdanov
Copy link

Came accross an issue with sticky alerts, I believe this is the correct set up for them, I read and re-read the docs. When ever I try to run a sticky alert I get an error, see below.

image
image
image

@stephannv
Copy link

Maybe your HTML is being loaded after halfmoon initialization. halfmoon fill stickyAlerts on object initialization using:

{
  ...
  stickyAlerts: document.getElementsByClassName("sticky-alerts")[0],
  ...

Maybe this can solve, but without a code sandbox to try it, I'm not sure. On line 22:

  halfmoon.stickyAlerts = document.getElementsByClassName("sticky-alerts")[0]
  halfmoon.initStickyAlert(...)

@halfmoonui halfmoonui added the v1 Version 1.x.x label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1 Version 1.x.x
Projects
None yet
Development

No branches or pull requests

3 participants