Open SumaiyaaRq opened 3 weeks ago
The newer versions of Vocabulary do null checks here, so this should be corrected as soon as the repository is updated to the latest Vocabulary. Moving to https://github.com/creativecommons/cc-resource-archive/labels/%F0%9F%9A%A7%20status%3A%20blocked until then
@possumbilities Thank you for confirming! I had a sense that the latest versions of Vocabulary included null checks, so it’s good to know this will be addressed when the repository is updated.
Description
I've noticed an issue in
vocabulary.js
where the code attempts to add an event listener tomenuButton
and toggle a class onmenuPanel,
but these elements are not present in the HTML file. This results in anUncaught TypeError
due to trying to calladdEventListener
onnull
.Reproduction
Expectation
The application should handle the absence of the
menuButton
andmenuPanel
elements gracefully without throwing an error.Screenshots
Suggested Fix:
Adding checks to see if
menuButton
andmenuPanel
exist before using them.Environment
Additional context
If the
menuButton
andmenuPanel
elements aren't needed because the menu functionality is not being used, the best approach might be to:Resolution