Closed (outdated)
Project:
Drupal core
Version:
11.x-dev
Component:
Umami demo
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Oct 2019 at 17:22 UTC
Updated:
7 Oct 2025 at 01:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
balsamaPatch checks to make sure toggler is not null before adding event listener.
Comment #3
zrpnrThis looks good, I confirmed this patch fixes the error logged in the console.
Document.querySelectorreturnsnullif no match is found, so checking for null makes sense here.tiny nit- this patch introduces 2 extra spaces before the closing bracket on line 21.
Comment #4
balsamaThanks. Patch updated.
Comment #5
zrpnrThe patch in #4 fixes the formatting issue, thanks!
Comment #6
mglaman👍 looks good to me. querySelector returns null if the element does not exist.
Follow up nit:
Should we also make sure
menuis null? Technically it should be... but both variables are required in `toggleMenu`Comment #7
shaalThank you for working on this!
I added some issue tags and related issues.
The mobile menu in Umami has numerous issues #2940023: [PP-1] Improve accessibility of Umami's responsive main menu
And we've been working on it through #3042417: Accessible dropdown for Umami's language-switcher and mobile main-menu that was reviewed today by @smaz, (only few minor changes left for it to be RTBC)
Both language-switcher AND mobile menu will use the same new component.
I am not sure if it would make sense to commit this patch if the other patch can be ready in the next day or two (and would replace all that JS code completely)
In the meantime... more eyes to review #3042417: Accessible dropdown for Umami's language-switcher and mobile main-menu would be awesome and appreciated!
Comment #8
balsamaAh - Ok. I was unaware of #3042417: Accessible dropdown for Umami's language-switcher and mobile main-menu. I would be happy to wait a few days and close this issue as outdated if/when that one lands. Thanks!
Comment #17
acbramley commentedThis was triaged as part of bug smash.
This javascript no longer exists in core, it was refactored (after being converted from es6) in #3404302: Create header component for Umami, with JS.
The new header JS looks safe, also confirmed by installing Umami and disabling the main nav block and didn't get a javascript error