Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove focusOut event listener as it breaks iOS Safari mobile menu behavior and didn't work anyway

Henriette Dinger0767b9f7b6dd
diff --git a/frontend/src/app/components/main-menu/main-menu-toggle.service.ts b/frontend/src/app/components/main-menu/main-menu-toggle.service.ts
index f9e4e11cdd3..68e8d32ca47 100644
--- a/frontend/src/app/components/main-menu/main-menu-toggle.service.ts
+++ b/frontend/src/app/components/main-menu/main-menu-toggle.service.ts
@@ -95,8 +95,6 @@ export class MainMenuToggleService {
if (!this.showNavigation) { // sidebar is hidden -> show menu
if (this.deviceService.isMobile) { // mobile version
this.setWidth(window.innerWidth);
- // On mobile the main menu shall close whenever you click outside the menu.
- this.setupAutocloseMainMenu();
} else { // desktop version
this.saveWidth(parseInt(window.OpenProject.guardedLocalStorage(this.localStorageKey) as string));
}
@@ -169,28 +167,6 @@ export class MainMenuToggleService {
this.htmlNode.style.setProperty("--main-menu-width", this.elementWidth + 'px');
}
- private setupAutocloseMainMenu():void {
- let that = this;
- jQuery('#main-menu').off('focusout.main_menu');
- jQuery('#main-menu').on('focusout.main_menu', function (event) {
- let originalEvent = event.originalEvent as FocusEvent;
- // Check that main menu is not closed and that the `focusout` event is not a click on an element
- // that tries to close the menu anyways.
- if (!that.showNavigation || document.getElementById('main-menu-toggle') === originalEvent.relatedTarget) {
- return;
- }
- else {
- // There might be a time gap between `focusout` and the focussing of the activeElement, thus we need a timeout.
- setTimeout(function() {
- if (!jQuery.contains(document.getElementById('main-menu')!, originalEvent.relatedTarget as Element)) {
- // activeElement is outside of main menu.
- that.closeMenu();
- }
- }, 0);
- }
- });
- }
-
private snapBack():void {
if (this.elementWidth <= 10) {
this.elementWidth = 0;