Skip to content

Commit

Permalink
Merge pull request #143 from Apes2getherStrong/hotfix-broken-forms
Browse files Browse the repository at this point in the history
hotfix broken forms
  • Loading branch information
Drillllll authored Nov 9, 2024
2 parents a6e42ab + 26996f8 commit f447e0f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/header/header.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="nav-container">

<div (click)="collapsed = true" class="nav-header">
<a routerLink="/">WayToGo fix1 </a>
<a routerLink="/">WayToGo fix2 </a>
</div>

<div style="flex-grow: 1"></div>
Expand Down
4 changes: 4 additions & 0 deletions src/app/route/route-edit/route-edit.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
input[type="text"], textarea {
-webkit-user-select: auto;
user-select: auto;
}
3 changes: 2 additions & 1 deletion src/app/route/route-edit/route-edit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ <h2 *ngIf="editMode" class="card-title">Editing Route</h2>

<div class="form-group mt-3">
<label class="card-text" for="name">Name</label>
<input class="form-control" formControlName="name" id="name" type="text">
<input class="form-control" formControlName="name" id="name"
type="text" autocomplete="off" (focus)="onFocus($event)">
</div>

<div class="form-group">
Expand Down
4 changes: 4 additions & 0 deletions src/app/route/route-edit/route-edit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,8 @@ export class RouteEditComponent implements OnInit, CanComponentDeactivate {
});
}
}

onFocus(event: Event): void {
event.preventDefault();
}
}
17 changes: 15 additions & 2 deletions src/app/shared/guards/can-deactivate-form-guard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class CanDeactivateFormGuardService {
constructor(private confirmationDialogService: ConfirmationDialogService) {}

canDeactivateForm(isDirty: boolean):Promise<boolean> {
if (isDirty) {
/*if (isDirty) {
return new Promise((resolve) => {
this.confirmationDialogService
.confirm(
Expand All @@ -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);
});
});
}
}

0 comments on commit f447e0f

Please sign in to comment.