[Bug] Uncaught TypeError in vocabulary.js due to Missing menuButton and menuPanel Elements . #345
Labels
💻 aspect: code
Concerns the software code in the repository
🛠 goal: fix
Bug fix
🟩 priority: low
Low priority and doesn't need to be rushed
🚧 status: blocked
Blocked & therefore, not ready for work
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
The text was updated successfully, but these errors were encountered: