You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should not be any errors in console due to undefined variables.
What is actually happening?
Error in console: Uncaught TypeError: Cannot read properties of null (reading 'classList') at 'navbarColorOnResize.
Solution
use optional chaining as below: if (referenceButtons?.classList.contains('active') && referenceButtons?.getAttribute('data-class') === 'bg-transparent') {
Additional comments
I'd be happy to contribute the fix for this.
The text was updated successfully, but these errors were encountered:
Thank you for using our products and for your solution to this issue. We are preparing an upgrade for this product this week, so if you want to contribute, please create a PR or we will integrate your solution in this next update.
Please let us know if we can help you with anything else.
All the best,
Stefan
Version
BS5
Reproduction link
Seneca-CDOT/telescope#2691
Operating System
Windows/OS
Device
PC
Browser & Version
Chrome Version 97.0.4692.99
Steps to reproduce
ReferenceButtons is not always defined, See
material-dashboard/assets/js/material-dashboard.js
Line 626 in 6671668
We should protect this.
What is expected?
There should not be any errors in console due to undefined variables.
What is actually happening?
Error in console:
Uncaught TypeError: Cannot read properties of null (reading 'classList') at 'navbarColorOnResize.
Solution
use optional chaining as below:
if (referenceButtons?.classList.contains('active') && referenceButtons?.getAttribute('data-class') === 'bg-transparent') {
Additional comments
I'd be happy to contribute the fix for this.
The text was updated successfully, but these errors were encountered: