Skip to content

Commit

Permalink
clone menu fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Heusschen committed Nov 20, 2022
1 parent a36065d commit 3b010c2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dist/mburger/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export default class extends HTMLElement {
__classPrivateFieldGet(this, _instances, "m", _disconnectMenu).call(this);
}
/** Node for the new menu. */
const menuNode = document.querySelector(`#mm-${newValue}, #${newValue}`);
const menuNode = document.querySelector(`#mm-${newValue}`) ||
document.querySelector(`#${newValue}`);
if (!menuNode) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mburger-webcomponent",
"version": "3.1.2",
"version": "3.1.3",
"main": "dist/mburger/index.js",
"module": "dist/mburger/index.js",
"author": "Fred Heusschen <info@mmenujs.com>",
Expand Down
5 changes: 4 additions & 1 deletion src/mburger/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export default class extends HTMLElement {
}

/** Node for the new menu. */
const menuNode: HTMLElement = document.querySelector(`#mm-${newValue}, #${newValue}`);
const menuNode: HTMLElement =
document.querySelector(`#mm-${newValue}`) ||
document.querySelector(`#${newValue}`);

if (!menuNode) {
return;
}
Expand Down

0 comments on commit 3b010c2

Please sign in to comment.