From 727c118f15a926017d2eed81b7e2d4f099801f27 Mon Sep 17 00:00:00 2001 From: Drillllll <118617644+Drillllll@users.noreply.github.com> Date: Sat, 9 Nov 2024 13:24:32 +0100 Subject: [PATCH 1/2] hotfix broken forms --- .../route/route-edit/route-edit.component.css | 4 ++++ .../route/route-edit/route-edit.component.html | 3 ++- .../route/route-edit/route-edit.component.ts | 4 ++++ .../guards/can-deactivate-form-guard.service.ts | 17 +++++++++++++++-- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/app/route/route-edit/route-edit.component.css b/src/app/route/route-edit/route-edit.component.css index e69de29..0bf09ef 100644 --- a/src/app/route/route-edit/route-edit.component.css +++ b/src/app/route/route-edit/route-edit.component.css @@ -0,0 +1,4 @@ +input[type="text"], textarea { + -webkit-user-select: auto; + user-select: auto; +} diff --git a/src/app/route/route-edit/route-edit.component.html b/src/app/route/route-edit/route-edit.component.html index bfb03eb..de8cee9 100644 --- a/src/app/route/route-edit/route-edit.component.html +++ b/src/app/route/route-edit/route-edit.component.html @@ -28,7 +28,8 @@

Editing Route

- +
diff --git a/src/app/route/route-edit/route-edit.component.ts b/src/app/route/route-edit/route-edit.component.ts index 6c6dad8..ee48f30 100644 --- a/src/app/route/route-edit/route-edit.component.ts +++ b/src/app/route/route-edit/route-edit.component.ts @@ -200,4 +200,8 @@ export class RouteEditComponent implements OnInit, CanComponentDeactivate { }); } } + + onFocus(event: Event): void { + event.preventDefault(); + } } diff --git a/src/app/shared/guards/can-deactivate-form-guard.service.ts b/src/app/shared/guards/can-deactivate-form-guard.service.ts index 28ac70e..0326efb 100644 --- a/src/app/shared/guards/can-deactivate-form-guard.service.ts +++ b/src/app/shared/guards/can-deactivate-form-guard.service.ts @@ -9,7 +9,7 @@ export class CanDeactivateFormGuardService { constructor(private confirmationDialogService: ConfirmationDialogService) {} canDeactivateForm(isDirty: boolean):Promise { - if (isDirty) { + /*if (isDirty) { return new Promise((resolve) => { this.confirmationDialogService .confirm( @@ -24,6 +24,19 @@ export class CanDeactivateFormGuardService { }); } else { return Promise.resolve(true); - } + }*/ + + return new Promise((resolve) => { + this.confirmationDialogService + .confirm( + 'Confirm Exiting', + `You are about to exit without saving the changes. Do you want to proceed?`, + 'Yes', + 'Cancel' + ) + .subscribe((confirmed: boolean) => { + resolve(confirmed); + }); + }); } } From 26996f8a16f5d9bea5d25959822a2c8bd5cdec59 Mon Sep 17 00:00:00 2001 From: Drillllll <118617644+Drillllll@users.noreply.github.com> Date: Sat, 9 Nov 2024 13:25:50 +0100 Subject: [PATCH 2/2] hotfix broken forms --- src/app/header/header.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/header/header.component.html b/src/app/header/header.component.html index e71f158..a4ca718 100644 --- a/src/app/header/header.component.html +++ b/src/app/header/header.component.html @@ -1,7 +1,7 @@