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

Trap focus inside drop modal

Benjamin Bädorf7febd68d71b7
diff --git a/frontend/src/app/spot/components/drop-modal/drop-modal.component.html b/frontend/src/app/spot/components/drop-modal/drop-modal.component.html
index 60d61026edf..0cf769a450d 100644
--- a/frontend/src/app/spot/components/drop-modal/drop-modal.component.html
+++ b/frontend/src/app/spot/components/drop-modal/drop-modal.component.html
@@ -2,14 +2,16 @@
<div
[ngClass]="['spot-drop-modal--body', 'spot-body', alignmentClass]"
(click)="onBodyClick($event)"
+ cdkTrapFocus
>
<ng-content select="[slot=body]"></ng-content>
+
+ <button
+ class="spot-drop-modal--close-button spot-button"
+ type="button"
+ aria-label="Close"
+ (click)="close()"
+ >
+ <span class="spot-icon spot-icon_close"></span>
+ </button>
</div>
-<button
- class="spot-drop-modal--close-button spot-button"
- type="button"
- aria-label="Close"
- (click)="close()"
->
- <span class="spot-icon spot-icon_close"></span>
-</button>
diff --git a/frontend/src/app/spot/spot.module.ts b/frontend/src/app/spot/spot.module.ts
index 3c39a361554..956f141fa3b 100644
--- a/frontend/src/app/spot/spot.module.ts
+++ b/frontend/src/app/spot/spot.module.ts
@@ -1,6 +1,7 @@
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
+import { A11yModule } from '@angular/cdk/a11y';
import { UIRouterModule } from '@uirouter/angular';
import { SPOT_DOCS_ROUTES } from './spot.routes';
import { SpotCheckboxComponent } from './components/checkbox/checkbox.component';
@@ -17,6 +18,7 @@ import { SpotDocsComponent } from './spot-docs.component';
UIRouterModule.forChild({ states: SPOT_DOCS_ROUTES }),
FormsModule,
CommonModule,
+ A11yModule,
],
declarations: [
SpotDocsComponent,
diff --git a/frontend/src/app/spot/styles/sass/components/drop-modal.sass b/frontend/src/app/spot/styles/sass/components/drop-modal.sass
index d813b87c55b..0172fb58b57 100644
--- a/frontend/src/app/spot/styles/sass/components/drop-modal.sass
+++ b/frontend/src/app/spot/styles/sass/components/drop-modal.sass
@@ -78,7 +78,6 @@
display: none
&--close-button
- @include spot-z-index("drop-modal", 1)
display: none
position: fixed
top: auto