lovelace-website icon indicating copy to clipboard operation
lovelace-website copied to clipboard

TypeError: Cannot read property 'addEventListener' of null

Open ksamuel opened this issue 3 years ago • 1 comments

When submitting a solutino to https://projectlovelace.net/problems/habitable-exoplanets/, the spinner is stuck forever, and the console displays the error "TypeError: Cannot read property 'addEventListener' of null". The debugger points to this part of the code, where dropdown contains null:

  <script>
    var dropdown = document.querySelector('.dropdown');
    dropdown.addEventListener('click', function(event) {
      event.stopPropagation();
      dropdown.classList.toggle('is-active');
    });
  </script>

Indeed, I can't find any node with the ".dropdown" class.

Firefox 87.0 in Ubuntu 21.04 but I get the same error in Chromium.

ksamuel avatar Apr 19 '21 12:04 ksamuel