md-dialog not closing anymore
With the latest HEAD the md-dialog does not close anymore. it works in 0.11.3
md-background is hidden but dialog still stays.
I am unable to reproduce this in our docs; please provide more details.
@ThomasBurleson: I have nailed it down more precisely:
- animation is disabled.
- dialog opacity is set to 0 and the dialog is not visible anymore (as reported once by myself)
In our app we are using menus which are triggering dialogs via directives as follows:
a)
<md-menu access-control resource="Project" operation="UPDATE,DELETE" owner="{{oid}}">
<div aria-label="Menu"
class="md-icon-button"
ng-click="$mdOpenMenu()">
<img class="pointer"
ng-src="template/icons/view/ic_arrow_drop_down_grey600_24dp.png">
</div>
<md-menu-content>
<md-menu-item access-control resource="Project" operation="UPDATE">
<md-button resource="Project" operation="UPDATE" project-member-workflow="member"
aria-label="User prozess" ng-click="" member="user">
<img src="template/icons/view/ic_create_grey600_24dp.png">
{{'STANDARD_BTN_PROCESS'| translate}}
</md-button>
</md-menu-item>
<md-divider access-control resource="Project" operation="DELETE"></md-divider>
<md-menu-item access-control resource="Project" operation="DELETE">
<md-button resource="Project" operation="DELETE" delete-match-member="member" ng-click="" aria-label="undo user"
member="user">
<img src="template/icons/view/ic_delete_grey600_24dp.png">{{'STANDARD_BTN_DELETE'
| translate}}
</md-button>
</md-menu-item>
</md-menu-content>
</md-menu>
b) the directive triggers the dialog as follows:
$mdDialog.show({
controller: myController,
templateUrl: 'app/module/mod_project/views/dialog.project.customer.edit.tpl.html',
targetEvent: event,
clickOutsideToClose: false,
escapeToClose: false,
bindToController: true,
locals: {object: localCopy}
}).then(onUpdate, onAbort);
Problem is the following:
- When disabling animation the dialog is not shown since opacity is 0
- When animation is enabled dialog it is shown but weired behaviour...
in 0.11.4 it works well but HEAD does not.
@EladBezalel - did we break something with our recent Dialog openFrom-, closeTo- features?
@ThomasBurleson nope, but I investigated this issue before, I will take a look.
@kschwidder works on both demos Basic, Open From Close To
maybe something in your code? can you post it on CodePen please?
@EladBezalel Just ran into this myself when the button that opened the menu was no longer visible via transform: scale(0).
Here is a codepen: https://codepen.io/topherfangio/pen/GpOyyg
Important note: if the button becomes immediately invisible (instead of waiting for the transition time), the dialog never appears either.
@topherfangio awesome! Thanks :)
@topherfangio @EladBezalel : :+1: This is exactly what happens in my cases !
- the dialog never appears sometimes which might be the button case as mentioned
- The dialog can not be closed as described.
I have to apologize my possible documentation inconvenience from a user perspective as I am not so deeply involved into internals of the library. What I frequently do is to report errors if our productive app if not behaving correctly as before :-)
Thx to all of your support. You are doing a great job !!!
@kschwidder thank you, your input is very helpful!
Has this been already committed in HEAD ? I checked and the problem still exists...
It seems so, can you please post a codepen so we could investigate it more deeply?
will try to provide one tomorrow.
@EladBezalel : http://codepen.io/anon/pen/XmzPNV
Last menu Item hangs still the dialog. In this case a directive is triggered on the click event. This works well upto 0.11.4 !
In addition the case of the "important note" of @topherfangio still exists
don't know if this helps but I am experiencing the same issue with confirm dialogs. It only occurs if the dialog is called as the result of an action on ng-click on an md-menu item.
+1. I'm triggering a dialog from a sidenav. It won't close.
Fixed in b69551c
The problem occurs because the menu item that opened the dialog is not visible anymore when the dialog tries to close.
on 71e23e5 i added openFrom, closeTo options that made specifically for this issue,
you should specify at lease closeTo element and the dialog will be opened from the selected menu item and be closed to the menu open button.
Latest HEAD does not solve the issue. Is it already committed ?
Not yet, waiting for #5302
+1 It seems dialogs don't close when opened from a menu. Not setting targetEvent on the dialog works around it, but of course loses the nice animation.
@bluebirdtech the problem there is that the menu is closed when the dialog tries to go back the place he came from (menu item),
the beautiful solution is to use the closeTo property and set the menu trigger as the element
This should be documented in the changelog as a breaking change.