{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3639","labels_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3639/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3639/comments","events_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3639/events","html_url":"https://github.com/angular-ui/bootstrap/issues/3639","id":73961427,"number":3639,"title":"Modal close fails in IE if modal was opened from js","user":{"login":"Hjertaas","id":5535999,"avatar_url":"https://avatars.githubusercontent.com/u/5535999?v=3","gravatar_id":"","url":"https://api.github.com/users/Hjertaas","html_url":"https://github.com/Hjertaas","followers_url":"https://api.github.com/users/Hjertaas/followers","following_url":"https://api.github.com/users/Hjertaas/following{/other_user}","gists_url":"https://api.github.com/users/Hjertaas/gists{/gist_id}","starred_url":"https://api.github.com/users/Hjertaas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hjertaas/subscriptions","organizations_url":"https://api.github.com/users/Hjertaas/orgs","repos_url":"https://api.github.com/users/Hjertaas/repos","events_url":"https://api.github.com/users/Hjertaas/events{/privacy}","received_events_url":"https://api.github.com/users/Hjertaas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/bootstrap/labels/AngularJS%201.4","name":"AngularJS 1.4","color":"fbca04"},{"url":"https://api.github.com/repos/angular-ui/bootstrap/labels/browser:%20IE11","name":"browser: IE11","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular-ui/bootstrap/milestones/18","html_url":"https://github.com/angular-ui/bootstrap/milestones/0.13.x","labels_url":"https://api.github.com/repos/angular-ui/bootstrap/milestones/18/labels","id":953016,"number":18,"title":"0.13.x","description":"Milestone for nice to have features and bug fixes with regards to Angular 1.3.x support","creator":{"login":"karianna","id":180840,"avatar_url":"https://avatars.githubusercontent.com/u/180840?v=3","gravatar_id":"","url":"https://api.github.com/users/karianna","html_url":"https://github.com/karianna","followers_url":"https://api.github.com/users/karianna/followers","following_url":"https://api.github.com/users/karianna/following{/other_user}","gists_url":"https://api.github.com/users/karianna/gists{/gist_id}","starred_url":"https://api.github.com/users/karianna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karianna/subscriptions","organizations_url":"https://api.github.com/users/karianna/orgs","repos_url":"https://api.github.com/users/karianna/repos","events_url":"https://api.github.com/users/karianna/events{/privacy}","received_events_url":"https://api.github.com/users/karianna/received_events","type":"User","site_admin":false},"open_issues":51,"closed_issues":6,"state":"open","created_at":"2015-01-27T11:36:36Z","updated_at":"2015-05-07T14:35:22Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-05-07T12:06:46Z","updated_at":"2015-05-07T14:41:09Z","closed_at":null,"body":"See stacktrace at the bottom.\r\n\r\nUsing angular: 1.4.0-beta.5 and angular-bootstrap: 0.13.0\r\nError seen on IE 9 and 11 (others not tested)\r\n\r\nIf modal dialog is initiated from javascript (say an Angular controller) there is no activeElement\r\nSee line 2209 in ui-bootstrap-tpls.js\r\nvar modalOpener = $document[0].activeElement;   // in IE this is undefined\r\n\r\nThis in turn results in a nullpointer in close() and dismiss() functions. Lines 2262 and 2273 respectively.\r\n\r\nWe are temporarily rectifying this by running this \r\nif (!window.document.activeElement) {\r\n    window.document.body.focus();\r\n}\r\nimmediately prior to calling $modal.open()\r\n\r\nTypeError: Unable to get property 'focus' of undefined or null reference\r\n   at $modalStack.close (http://localhost:9000/ext/angular-bootstrap/ui-bootstrap-tpls.js:2262:11)\r\n   at modalInstance.close (http://localhost:9000/ext/angular-bootstrap/ui-bootstrap-tpls.js:2340:17)\r\n   at fn (Function code:2:191)\r\n   at callback (http://localhost:9000/ext/angular/angular.js:22335:17)\r\n   at Scope.prototype.$eval (http://localhost:9000/ext/angular/angular.js:15236:9)\r\n   at Scope.prototype.$apply (http://localhost:9000/ext/angular/angular.js:15335:11)\r\n   at Anonymous function (http://localhost:9000/ext/angular/angular.js:22340:17)\r\n   at jQuery.event.dispatch (http://localhost:9000/ext/jquery/dist/jquery.js:4664:6)\r\n   at elemData.handle (http://localhost:9000/ext/jquery/dist/jquery.js:4332:5)\r\n   at jQuery.event.dispatch (https://example.com/plugins.3619bc3f.js:3:14958)\r\n   at elemData.handle (https://example.com/plugins.3619bc3f.js:3:9674)"},"comment":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/comments/99891631","html_url":"https://github.com/angular-ui/bootstrap/issues/3639#issuecomment-99891631","issue_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3639","id":99891631,"user":{"login":"rvanbaalen","id":220637,"avatar_url":"https://avatars.githubusercontent.com/u/220637?v=3","gravatar_id":"","url":"https://api.github.com/users/rvanbaalen","html_url":"https://github.com/rvanbaalen","followers_url":"https://api.github.com/users/rvanbaalen/followers","following_url":"https://api.github.com/users/rvanbaalen/following{/other_user}","gists_url":"https://api.github.com/users/rvanbaalen/gists{/gist_id}","starred_url":"https://api.github.com/users/rvanbaalen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvanbaalen/subscriptions","organizations_url":"https://api.github.com/users/rvanbaalen/orgs","repos_url":"https://api.github.com/users/rvanbaalen/repos","events_url":"https://api.github.com/users/rvanbaalen/events{/privacy}","received_events_url":"https://api.github.com/users/rvanbaalen/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T14:41:09Z","updated_at":"2015-05-07T14:41:09Z","body":"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.\r\n\r\nIf 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.\r\n\r\nPersonally, 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."}}