-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guarded route support to ConfirmDialog #2194
Comments
I have found some other weak points in the ConfirmDialog.
|
Send a PR please Oleg. |
@cagataycivici I have created a PR for weak points: #3201 It looks cleaner now. The issue on close was already fixed earlier. Thanks. Oleg. |
#921 should fix the original issue right?
|
Yes, the original issue is fixed by #921. This PR fixes weak points I mentioned in "I have found some other weak points in the ConfirmDialog." |
It's disappointing that PR has conflicts now. Why do we need this.executePostShowActions? Can we not always set focus on first button in the confirm dialog? |
Sorry, this.executePostShowActions is to focus button after show. I can merge manually later, no problem. |
I've solved conflicts. No problem. You can merge the PR. |
If you use
ConfirmDialog
withCanDeactivate
guard, you normally have to returnPromise
orObservable
in thecanDeactivate
method. Here is the method signature: https://angular.io/docs/ts/latest/api/router/index/CanDeactivate-interface.html This works very well as long the user clicks onaccept
orreject
buttons. But when the user clicks on the dialog's close button (or hit escape key), the dialog gets closed and can not be opened after that. It stops to work.Demo is created: https://github.com/ova2/frontend-tooling-tutorial/tree/master/angular-playground/router-primeng-confirmdialog
I think in the
confirmdialog.ts
, you should not invoke(click)="hide($event)"
on close. You should invoke(click)="reject($event)"
. If you invokereject
which invokeshide
on its parts, the dialog is ok. Also on hitting escape key, thethis.reject(event)
should be called instead ofthis.hide(event)
.Should I provide a pull request?
Thanks.
The text was updated successfully, but these errors were encountered: