{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/7889","repository_url":"https://api.github.com/repos/facebook/react","labels_url":"https://api.github.com/repos/facebook/react/issues/7889/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/7889/comments","events_url":"https://api.github.com/repos/facebook/react/issues/7889/events","html_url":"https://github.com/facebook/react/issues/7889","id":181275473,"number":7889,"title":"DOM contents not ready after first update in incognito/private window.","user":{"login":"kjs3","id":91996,"avatar_url":"https://avatars.githubusercontent.com/u/91996?v=3","gravatar_id":"","url":"https://api.github.com/users/kjs3","html_url":"https://github.com/kjs3","followers_url":"https://api.github.com/users/kjs3/followers","following_url":"https://api.github.com/users/kjs3/following{/other_user}","gists_url":"https://api.github.com/users/kjs3/gists{/gist_id}","starred_url":"https://api.github.com/users/kjs3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjs3/subscriptions","organizations_url":"https://api.github.com/users/kjs3/orgs","repos_url":"https://api.github.com/users/kjs3/repos","events_url":"https://api.github.com/users/kjs3/events{/privacy}","received_events_url":"https://api.github.com/users/kjs3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-05T21:52:23Z","updated_at":"2016-10-07T13:10:02Z","closed_at":null,"body":"**Bug**\r\n\r\n**Current behavior:**\r\n\r\nI am attempting to load data from an API, display, and then scroll to a URL fragment deep in the document. Window only partially scrolls.\r\n\r\nThis may have more to do with browser behavior but I can't figure out how to reliably wait for content to be painted before scrolling it into view on the first attempt.\r\n\r\n**Here's an example showing the issue:**\r\n\r\n1. open a _new_ incognito (Chrome) or private (Firefox) window.\r\n2. paste (or type, sorry FF) this URL - https://jsbin.com/pecuxi/8/edit?js,console,output\r\n\r\n* data will be loaded from iTunes and saved to state\r\n* `render` is triggered\r\n* `componentDidUpdate` is triggered\r\n* `window.requestAnimationFrame` is used to let DOM painting occur\r\n* DOM node deep in document is queried and attempted to scroll into view (correct node has a red background)\r\n\r\nI've never seen this work with a fresh incognito/private window.\r\n\r\n[Here's an issue](https://github.com/facebook/react/issues/2659) where using `requestAnimationFrame` is suggested.\r\n[Here is a SO answer with discussion about this.](http://stackoverflow.com/a/28748160/184532)\r\n\r\n**What is the expected behavior?**\r\nDOM node scrolled into view\r\n\r\n**Versions of React:** `15.1+`\r\n\r\n**Browsers / OS:** `Mac OS X 10.11.6`\r\n\r\n**Did not work with previous versions of React**\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/252247780","html_url":"https://github.com/facebook/react/issues/7889#issuecomment-252247780","issue_url":"https://api.github.com/repos/facebook/react/issues/7889","id":252247780,"user":{"login":"syranide","id":1714255,"avatar_url":"https://avatars.githubusercontent.com/u/1714255?v=3","gravatar_id":"","url":"https://api.github.com/users/syranide","html_url":"https://github.com/syranide","followers_url":"https://api.github.com/users/syranide/followers","following_url":"https://api.github.com/users/syranide/following{/other_user}","gists_url":"https://api.github.com/users/syranide/gists{/gist_id}","starred_url":"https://api.github.com/users/syranide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syranide/subscriptions","organizations_url":"https://api.github.com/users/syranide/orgs","repos_url":"https://api.github.com/users/syranide/repos","events_url":"https://api.github.com/users/syranide/events{/privacy}","received_events_url":"https://api.github.com/users/syranide/received_events","type":"User","site_admin":false},"created_at":"2016-10-07T13:10:02Z","updated_at":"2016-10-07T13:10:02Z","body":"Have you deferred `ReactDOM.render` until `DOMContentLoaded` (may or may not affect)? Otherwise it should work as is AFAIK, when `componentDidMount` is called everything has been flushed to DOM and there's nothing left for React to do. So intuitively it should work. However, you have to remember that images may not have been downloaded then and later increase the size of the rows, throwing it off. Same applies to webfonts. If stylesheets are loaded after your script then that will also throw off measurements.\r\n\r\nFrom the brief flickering I see in your fiddle it seems that it has to do with images not being pre-sized and thus throw off the initial measurements when they begin to load."}}
{"actor":{"display_login":"syranide"}}