bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Feature Request: Backdrop click event handler before closing modal because of backdrop click

Open abhranilnaha opened this issue 10 years ago • 3 comments

I am using modal dialog as a form for some fields. When user enters some values in that form and closes the modal by clicking on the backdrop, I want to check if the form is dirty and notify user to save unsaved data before closing the modal. Currently, there is no event handler which is called before closing the modal for backdrop click. Please add this feature if possible.

Angular Version: 1.4.0 Bootstrap version: 0.13.0

abhranilnaha avatar Mar 16 '16 03:03 abhranilnaha

One can do this easily by using backdrop: 'static' and creating a custom directive that binds an event listener on the backdrop to allow custom action to occur in a user-defined flow, then close the modal on affirmative behavior.

wesleycho avatar Mar 16 '16 03:03 wesleycho

Do you have any example for a custom directive to bind an event listener on the backdrop?

abhranilnaha avatar Jun 02 '16 22:06 abhranilnaha

Can you please share an example of custom directive to bind an event listener on backdrop ? Also How can I pass some data on backdrop click ? As I have to show another dialog based upon that data over it

webkhushboo avatar Aug 21 '18 08:08 webkhushboo