Added @tomMalbran's code for app-shell-menu scenario.