#52473 closed defect (bug) (fixed)
Twenty Twenty-One: Dark Mode toggle is causing JavaScript error in block editor
Reported by: | ocean90 | Owned by: | desrosj |
---|---|---|---|
Milestone: | 5.7 | Priority: | normal |
Severity: | normal | Version: | 5.6 |
Component: | Bundled Theme | Keywords: | has-patch commit |
Focuses: | javascript, administration | Cc: |
Description (last modified by )
For some reasons the dark-mode-toggler.js
from Twenty Twenty-One is also enqueued in the block editor if Dark Mode support is enabled. This is causing JavaScript errors if the window (not the editor itself) is scrolled.
Uncaught TypeError: Cannot read property 'classList' of null at checkScroll (dark-mode-toggler.js?ver=1.0.0:56)
To reproduce enable Dark Mode support in the Customizer and open the block editor. Now reduce the height of the window so that you're able to scroll the admin menu. Once you scroll you should see the JavaScript error from above in the console.
The script should either check that the toggle exists or better not enqueued in the block editor at all.
Attachments (4)
Change History (11)
#3
@
4 years ago
- Keywords commit added
I can reproduce the issue on Safari.
After applying the patch the error is gone.
Adding the commit
keyword to the ticket.
52473.diff patch fix the issue.