{"action":"created","issue":{"url":"https://api.github.com/repos/twbs/bootstrap/issues/16050","labels_url":"https://api.github.com/repos/twbs/bootstrap/issues/16050/labels{/name}","comments_url":"https://api.github.com/repos/twbs/bootstrap/issues/16050/comments","events_url":"https://api.github.com/repos/twbs/bootstrap/issues/16050/events","html_url":"https://github.com/twbs/bootstrap/issues/16050","id":60832334,"number":16050,"title":"IE scrolls top of iframe into view when modal within the iframe is shown","user":{"login":"danschumann","id":1516973,"avatar_url":"https://avatars.githubusercontent.com/u/1516973?v=3","gravatar_id":"","url":"https://api.github.com/users/danschumann","html_url":"https://github.com/danschumann","followers_url":"https://api.github.com/users/danschumann/followers","following_url":"https://api.github.com/users/danschumann/following{/other_user}","gists_url":"https://api.github.com/users/danschumann/gists{/gist_id}","starred_url":"https://api.github.com/users/danschumann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danschumann/subscriptions","organizations_url":"https://api.github.com/users/danschumann/orgs","repos_url":"https://api.github.com/users/danschumann/repos","events_url":"https://api.github.com/users/danschumann/events{/privacy}","received_events_url":"https://api.github.com/users/danschumann/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/twbs/bootstrap/labels/confirmed","name":"confirmed","color":"b94a48"},{"url":"https://api.github.com/repos/twbs/bootstrap/labels/js","name":"js","color":"ffc40d"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-03-12T15:00:06Z","updated_at":"2015-03-12T19:44:31Z","closed_at":null,"body":"Hello,\r\n\r\nI have an iframe that is like 3000+ pixels in height.  The top page scrolls, as the iframe will be whatever size it needs to be, so that it won't have a scrollbar.\r\n\r\nThere is a problem in IE, caused by this line: \r\n\r\n```\r\n      transition ?\r\n        that.$element.find('.modal-dialog') // wait for modal to slide in\r\n          .one('bsTransitionEnd', function () {\r\n            that.$element.trigger('focus').trigger(e) // this line causes the problem!!!\r\n            that.$element.trigger(e) // this fixes the problem!!!\r\n          })\r\n          .emulateTransitionEnd(Modal.TRANSITION_DURATION) :\r\n        that.$element.trigger('focus').trigger(e)\r\n```\r\n\r\nAt approximately line 998 in 3.3.2\r\n\r\nAs you can see, removing trigger('focus') fixes it.\r\n\r\nThe problem in detail is:  the top frame's scrollTop becomes the iframes offset().top.\r\n\r\nThis can be very unwanted.  The user may be 2000 pixels into the iframe content, looking at something at the bottom, and when they open a modal, they are way at the top of the page again ( top of the iframe at least ).\r\n\r\nHere is a hack I am using to fix:\r\n```\r\n    $modal.on('show.bs.modal', function(){\r\n      // IE Fix:  bootstrap does a focus, which screws up the iframe by scrolling the parent window\r\n      setTimeout(function(){\r\n        $modal.find('.modal-dialog').off('bsTransitionEnd');\r\n      }, 350);\r\n    });\r\n```"},"comment":{"url":"https://api.github.com/repos/twbs/bootstrap/issues/comments/78589716","html_url":"https://github.com/twbs/bootstrap/issues/16050#issuecomment-78589716","issue_url":"https://api.github.com/repos/twbs/bootstrap/issues/16050","id":78589716,"user":{"login":"danschumann","id":1516973,"avatar_url":"https://avatars.githubusercontent.com/u/1516973?v=3","gravatar_id":"","url":"https://api.github.com/users/danschumann","html_url":"https://github.com/danschumann","followers_url":"https://api.github.com/users/danschumann/followers","following_url":"https://api.github.com/users/danschumann/following{/other_user}","gists_url":"https://api.github.com/users/danschumann/gists{/gist_id}","starred_url":"https://api.github.com/users/danschumann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danschumann/subscriptions","organizations_url":"https://api.github.com/users/danschumann/orgs","repos_url":"https://api.github.com/users/danschumann/repos","events_url":"https://api.github.com/users/danschumann/events{/privacy}","received_events_url":"https://api.github.com/users/danschumann/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T19:44:31Z","updated_at":"2015-03-12T19:44:31Z","body":"Whatever is done, I think it should be optional or opt-out-able, since if i wasn't using the transitions here, I don't think I'd have any recourse to call `.off('bsTransitionEnd')`\r\n\r\nI don't actually want to focus, since I have to handle that myself by resizing the iframe if the modal is too big, and more commonly, offsetting the modal to match the screen.\r\n\r\nMy `modal.css({top: ...});` functions similar to the columns on facebook.  It keeps it at the top if you're above it, you can scroll through it, and when you reach the end, it keeps the bottom if you're below it.  It looks rather nice, especially considering it is an iframe workaround and not a feature."}}