-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Modal close fails in IE if modal was opened from js #3639
Comments
We don't support AngularJS 1.4 yet. |
Still a valid issue though, putting a 0.13.x milestone on it (e.g. Fix when we get round to looking at 1.4 support) |
I get your point @karianna. But I would have to disagree on the part where this would be a 'valid issue'. Yes, this is probably a bug in UI Bootstrap. But like I said -- no one is stating that UI Bootstrap is expected to work with the latest beta AngularJS version. If we would accept all these issues (and even without plunkrs to reproduce it!), next time we'll get a bunch of new issues about people reporting that UI Bootstrap is not compatible with AngularJS 2.0 developer preview. Personally, I'm all about closing issues fast and keep the amount of open issues to a minimum. Everyone can re-add an issue as soon as a stable AngularJS release is out and this is still reproducible. Lets discuss that policy with the rest of the team. |
Ah, I missed that this is angular 1.4 Beta. OK, I'm going to shove this into purgatory for now. |
My take would be to have issues (or one meta-issue) for 1.4 support and a corresponding label / milestone. 1.4 is round-the-corner and pretty stable. There were substential changes in animatations support in 1.4, so this will be probably the only area where migration efforts will be needed. As for the 2.0 support - we should make it clear that the project, in the current form, focuses on 1.x. |
OK, well we've attached the label, so this should be easy enough to find |
Hi, this has nothing to do with angular version. It seems activeElement can be flaky in IE. Try this plnkr in IE: If you have the console open you will notice a javasccript exception. |
See stacktrace at the bottom.
Using angular: 1.4.0-beta.5 and angular-bootstrap: 0.13.0
Error seen on IE 9 and 11 (others not tested)
If modal dialog is initiated from javascript (say an Angular controller) there is no activeElement
See line 2209 in ui-bootstrap-tpls.js
var modalOpener = $document[0].activeElement; // in IE this is undefined
This in turn results in a nullpointer in close() and dismiss() functions. Lines 2262 and 2273 respectively.
We are temporarily rectifying this by running this
if (!window.document.activeElement) {
window.document.body.focus();
}
immediately prior to calling $modal.open()
TypeError: Unable to get property 'focus' of undefined or null reference
at $modalStack.close (http://localhost:9000/ext/angular-bootstrap/ui-bootstrap-tpls.js:2262:11)
at modalInstance.close (http://localhost:9000/ext/angular-bootstrap/ui-bootstrap-tpls.js:2340:17)
at fn (Function code:2:191)
at callback (http://localhost:9000/ext/angular/angular.js:22335:17)
at Scope.prototype.$eval (http://localhost:9000/ext/angular/angular.js:15236:9)
at Scope.prototype.$apply (http://localhost:9000/ext/angular/angular.js:15335:11)
at Anonymous function (http://localhost:9000/ext/angular/angular.js:22340:17)
at jQuery.event.dispatch (http://localhost:9000/ext/jquery/dist/jquery.js:4664:6)
at elemData.handle (http://localhost:9000/ext/jquery/dist/jquery.js:4332:5)
at jQuery.event.dispatch (https://example.com/plugins.3619bc3f.js:3:14958)
at elemData.handle (https://example.com/plugins.3619bc3f.js:3:9674)
The text was updated successfully, but these errors were encountered: