Skip to content

Commit

Permalink
fix(masthead-v2): use more explicit selector in dropdown toggle (#11084)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkaeser authored Nov 2, 2023
1 parent 2e446d9 commit 911f802
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,10 @@ class DDSMastheadL1 extends StableSelectorMixin(LitElement) {
const { isMobileVersion } = this;
const { currentTarget } = event;
const button = currentTarget as HTMLElement;
const dropdown = button.nextElementSibling as HTMLElement;
const isOpen = dropdown.classList.contains('is-open');
const dropdown = button.parentNode?.querySelector(
`.${prefix}--masthead__l1-dropdown`
) as HTMLElement;
const isOpen = dropdown?.classList.contains('is-open');

if (!isMobileVersion && dropdown && !isOpen) {
// Get Button & Dropdown locations & widths
Expand Down

0 comments on commit 911f802

Please sign in to comment.