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

Add focus trapping to confirm dialog

Oliver Güntherfdfaad223062
diff --git a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html
index 6ea83516b1c..5178df77c05 100644
--- a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html
+++ b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html
@@ -1,6 +1,10 @@
<div
class="spot-modal op-confirm-dialog loading-indicator--location"
data-indicator-name="modal"
+ tabindex="0"
+ cdkFocusInitial
+ cdkTrapFocus
+ [cdkTrapFocusAutoCapture]="true"
>
<div class="spot-modal--header">{{text.title}}</div>
<div class="spot-divider"></div>
@@ -17,9 +21,10 @@
<div class="spot-modal--footer spot-action-bar">
<div class="spot-action-bar--right">
- <button class="button button_no-margin spot-action-bar--action"
- data-qa-selector="confirmation-modal--cancel"
- (click)="closeMe($event)"
+ <button
+ class="button button_no-margin spot-action-bar--action"
+ data-qa-selector="confirmation-modal--cancel"
+ (click)="closeMe($event)"
>
<op-icon
*ngIf="icon.cancel as clazz"
@@ -33,10 +38,11 @@
class="button--text"
>{{text.button_cancel}}</span>
</button>
- <button class="button button_no-margin spot-action-bar--action"
- data-qa-selector="confirmation-modal--confirmed"
- [ngClass]="dangerHighlighting ? '-danger': '-highlight'"
- (click)="confirmAndClose($event)"
+ <button
+ class="button button_no-margin spot-action-bar--action"
+ data-qa-selector="confirmation-modal--confirmed"
+ [ngClass]="dangerHighlighting ? '-danger': '-highlight'"
+ (click)="confirmAndClose($event)"
>
<op-icon
*ngIf="icon.continue as clazz"
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index f0eacefd275..97c4b40358b 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -89,6 +89,7 @@ import { OpLoadingProjectListComponent } from './components/searchable-project-l
import { ViewsResourceService } from 'core-app/core/state/views/views.service';
import { OpenprojectContentLoaderModule } from 'core-app/shared/components/op-content-loader/openproject-content-loader.module';
import { UIRouterGlobals } from '@uirouter/core';
+import { A11yModule } from '@angular/cdk/a11y';
export function bootstrapModule(injector:Injector):void {
// Ensure error reporter is run
@@ -119,6 +120,7 @@ export function bootstrapModule(injector:Injector):void {
FormsModule,
OpSpotModule,
// Angular CDK
+ A11yModule,
PortalModule,
DragDropModule,
DragulaModule,
@@ -144,6 +146,7 @@ export function bootstrapModule(injector:Injector):void {
FormsModule,
PortalModule,
DragDropModule,
+ A11yModule,
IconModule,
AttributeHelpTextModule,
NgSelectModule,
diff --git a/frontend/src/app/spot/spot.module.ts b/frontend/src/app/spot/spot.module.ts
index 0d872fdd554..091a0475e60 100644
--- a/frontend/src/app/spot/spot.module.ts
+++ b/frontend/src/app/spot/spot.module.ts
@@ -18,7 +18,6 @@ import { SpotDocsComponent } from './spot-docs.component';
UIRouterModule.forChild({ states: SPOT_DOCS_ROUTES }),
FormsModule,
CommonModule,
- A11yModule,
],
declarations: [
SpotDocsComponent,