Hi Gabor,
Indeed you are right, so far there is no parameter that can be used to distinguish if the Escape key is pressed or the X close icon in the title bar is clicked.
What could be done in the meantime is to prevent close action using the preventAction callback:
preventAction:(args)=>{
if(args instanceof DialogCloseResult){
return true
}
},
and use a custom component for the Dialog content. Thus the Dialog can still be closed by handling the respective button click events. Here is an example where the Escape key doesn't close the Dialog while all other options remain unchanged:
https://stackblitz.com/edit/angular-itjo1r
Regards,
Martin
Progress Telerik
I finally managed to implement this behavior by using
event.stopPropagation();
So if the focus is on an element inside the modal (textbox) this prohibits closing the modal.
Hello again,
Since I use the DialogService this
doCloseOnEscapeKey
option might become part of the DialogSettings interface.
open(options: DialogSettings): DialogRef;
Thank you very much.
Your components are awesome!!
Kind Regards,
Josef
Hello Dimiter,
Thank you for your reply.
I understand that this might not be a high priority issue. Nevertheless it might be easy and not time-consuming to implement.
I am looking forward to an Angular-Component-Input to deactivate this "doCloseOnEscapeKey" functionality.
Kind regards,
Josef