{"action":"created","issue":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2310","labels_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2310/labels{/name}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2310/comments","events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2310/events","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2310","id":57115736,"number":2310,"title":"Make sure before:render is triggered before modifying layout view.","user":{"login":"scottaj","id":340152,"avatar_url":"https://avatars.githubusercontent.com/u/340152?v=3","gravatar_id":"","url":"https://api.github.com/users/scottaj","html_url":"https://github.com/scottaj","followers_url":"https://api.github.com/users/scottaj/followers","following_url":"https://api.github.com/users/scottaj/following{/other_user}","gists_url":"https://api.github.com/users/scottaj/gists{/gist_id}","starred_url":"https://api.github.com/users/scottaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottaj/subscriptions","organizations_url":"https://api.github.com/users/scottaj/orgs","repos_url":"https://api.github.com/users/scottaj/repos","events_url":"https://api.github.com/users/scottaj/events{/privacy}","received_events_url":"https://api.github.com/users/scottaj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/labels/major","name":"major","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-10T01:07:16Z","updated_at":"2015-02-16T20:33:23Z","closed_at":"2015-02-16T20:33:23Z","pull_request":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2310","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2310","diff_url":"https://github.com/marionettejs/backbone.marionette/pull/2310.diff","patch_url":"https://github.com/marionettejs/backbone.marionette/pull/2310.patch"},"body":"To me, the implications of the `before:render` event is that it runs before rendering any changes in the DOM. This is true for ItemView, but LayoutView was resetting its regions before triggering the event. This means that the DOM has already been modified because the subviews have been removed.\r\n\r\nI ran into this while trying to write some code that would find the currently focused element on the page (which could be in a view or its subviews) and record that element so it could be re-focused after re-rendering. The code didn't work because the subviews were already gone, and I had to override `render` instead."},"comment":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/comments/74568368","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2310#issuecomment-74568368","issue_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2310","id":74568368,"user":{"login":"samccone","id":883126,"avatar_url":"https://avatars.githubusercontent.com/u/883126?v=3","gravatar_id":"","url":"https://api.github.com/users/samccone","html_url":"https://github.com/samccone","followers_url":"https://api.github.com/users/samccone/followers","following_url":"https://api.github.com/users/samccone/following{/other_user}","gists_url":"https://api.github.com/users/samccone/gists{/gist_id}","starred_url":"https://api.github.com/users/samccone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samccone/subscriptions","organizations_url":"https://api.github.com/users/samccone/orgs","repos_url":"https://api.github.com/users/samccone/repos","events_url":"https://api.github.com/users/samccone/events{/privacy}","received_events_url":"https://api.github.com/users/samccone/received_events","type":"User","site_admin":false},"created_at":"2015-02-16T20:33:23Z","updated_at":"2015-02-16T20:33:23Z","body":"merged into major, we are not going to put this into minor just because we are fairly sure this is going to cause issues for people with their applications.\r\n\r\nAgain, at some point bugs that have been coded against become breaking changes. :8ball: "}}