{"action":"created","issue":{"url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React/issues/2621","repository_url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React","labels_url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React/issues/2621/labels{/name}","comments_url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React/issues/2621/comments","events_url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React/issues/2621/events","html_url":"https://github.com/Semantic-Org/Semantic-UI-React/pull/2621","id":303567952,"number":2621,"title":"feat(Responsive): add getWidth prop, fix perf","user":{"login":"andrewferk","id":113192,"avatar_url":"https://avatars1.githubusercontent.com/u/113192?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewferk","html_url":"https://github.com/andrewferk","followers_url":"https://api.github.com/users/andrewferk/followers","following_url":"https://api.github.com/users/andrewferk/following{/other_user}","gists_url":"https://api.github.com/users/andrewferk/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewferk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewferk/subscriptions","organizations_url":"https://api.github.com/users/andrewferk/orgs","repos_url":"https://api.github.com/users/andrewferk/repos","events_url":"https://api.github.com/users/andrewferk/events{/privacy}","received_events_url":"https://api.github.com/users/andrewferk/received_events","type":"User","site_admin":false},"labels":[{"id":226591379,"url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React/labels/enhancement","name":"enhancement","color":"c5def5","default":true},{"id":453542456,"url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React/labels/needs%20author%20feedback","name":"needs author feedback","color":"5319e7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-08T17:38:04Z","updated_at":"2018-04-13T16:15:37Z","closed_at":"2018-04-13T16:15:34Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React/pulls/2621","html_url":"https://github.com/Semantic-Org/Semantic-UI-React/pull/2621","diff_url":"https://github.com/Semantic-Org/Semantic-UI-React/pull/2621.diff","patch_url":"https://github.com/Semantic-Org/Semantic-UI-React/pull/2621.patch"},"body":"Implements #2614 \r\n\r\n1. Revert #2531, as it breaks `Responsive`'s integration with Semantic UI's breakpoints. This ensures `Responsive` uses `window.innerWidth` as the default calculation for screen width. `document.documentElement.clientWidth` does not use the scrollbar in its calculation.\r\n\r\n2. Fix false-positive tests in `Responsive-test.js`. [`chai-enzyme`](https://github.com/producthunt/chai-enzyme) provides assertion helpers [`blank()`](https://github.com/producthunt/chai-enzyme#blank) and [`present()`](https://github.com/producthunt/chai-enzyme#present), which were being used as if they were opposites. They are not opposites. For a wrapper to be `empty()`, it must also be `present()`. Tests have been updated to use `not.empty()` and `empty()`, which are opposites. Also, the resizing test was using enzyme's `shallow()`, but `mount()` was needed to support state change and updating render.\r\n\r\n3. Add optional `getWidth` property to `Responsive`. The property is a function that returns the width of the screen. This property defaults to a function that returns `window.innerWidth` for browsers and `0` for non-browsers. @Autarc or anyone else wanting to use `document.documentElement.clientWidth` as discussed in #2531 can do so using `<Responsive getWidth={() => document.documentElement.clientWidth} />`.\r\n\r\n4. Prevent `Responsive` from updating render when `window.resize` is triggered, but width does not change. `Responsive` currently updates on mobile devices when scrolling and the url bar displays and hides. This happens because the height of the window is changing, triggering `window.resize`. This update allows `Responsive` to ignore these events. `onUpdate` will still be invoked."},"comment":{"url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React/issues/comments/381186166","html_url":"https://github.com/Semantic-Org/Semantic-UI-React/pull/2621#issuecomment-381186166","issue_url":"https://api.github.com/repos/Semantic-Org/Semantic-UI-React/issues/2621","id":381186166,"user":{"login":"welcome[bot]","id":30606887,"avatar_url":"https://avatars0.githubusercontent.com/in/4141?v=4","gravatar_id":"","url":"https://api.github.com/users/welcome%5Bbot%5D","html_url":"https://github.com/apps/welcome","followers_url":"https://api.github.com/users/welcome%5Bbot%5D/followers","following_url":"https://api.github.com/users/welcome%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/welcome%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/welcome%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welcome%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/welcome%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/welcome%5Bbot%5D/repos","events_url":"https://api.github.com/users/welcome%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/welcome%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-04-13T16:15:37Z","updated_at":"2018-04-13T16:15:37Z","author_association":"NONE","body":"Congrats on merging your first pull request! 🎉🎉🎉\n\n![robot victory dance](https://media.giphy.com/media/tczJoRU7XwBS8/giphy.gif)\n"}}
{"actor":{"display_login":"welcome"}}