Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

mdp-datepicker inside mdDialog - Close button #99

Closed
tehabstract opened this issue May 10, 2016 · 4 comments
Closed

mdp-datepicker inside mdDialog - Close button #99

tehabstract opened this issue May 10, 2016 · 4 comments

Comments

@tehabstract
Copy link

tehabstract commented May 10, 2016

I know that nesting mdDialog is not supported, but I tried it and it worked, only I had a problem with closing the mdp-datepicker, since the close button would close the first dialog opened. So I fixed with editing 132 line of code and giving it an confirm with no arguments. I leave up to you to think about adding it ... Anyways good work, starred!

Edit: Just found out it resets my model, but nvm I'll still go with this :)
Edit 2: Okay, fixed it with currentDate as argument :)

this.cancel = function() {
    if (currentDate instanceof Date) {
        $mdDialog.hide(currentDate);
    } else {
        $mdDialog.hide(null);
    }
};
@alenaksu
Copy link
Owner

@tehabstract please take a look here and tell me if it helps
#72

@pabramowitsch
Copy link

Thanks for the fix tehabstract, If you're already in a popup you'd probably also want to put
clickOutsideToClose : false, at around line 181 where the popup is defined.
As set to true If you click outside the date dialog it will close the underlying dialog first.

@marchrius
Copy link

marchrius commented Jun 22, 2016

You can use skipHide: true on parent $mdDialog to skip the hide event and close manually.

Reference: Angular Material Issue 7262

@alenaksu
Copy link
Owner

I close the issue. Feel free to reopen if you need support

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants