Skip to content

Commit c6d73ba

Browse files
committed
fix: click router link when any part of the menu item is clicked
1 parent 611666f commit c6d73ba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/resources/META-INF/frontend/fc-applayout/fc-menuitem.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ class MenuItem extends ThemableMixin(PolymerElement) {
122122
};
123123
this.addEventListener('focus', listener);
124124
this.addEventListener('click', listener);
125+
this.addEventListener('click', (event) => {
126+
//https://stackoverflow.com/a/39245638/1297272
127+
//this won't work if the browser doesn't supply path information (IE11)
128+
var path = event.path || (event.composedPath && event.composedPath());
129+
if (this.href && path && path[0].id!="label") this.shadowRoot.querySelector("a#label").click();
130+
});
125131
this.addEventListener('mousedown', (event) => {
126132
if (event.button==1) {
127133
event.preventDefault();

0 commit comments

Comments
 (0)