{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/10260","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/10260/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/10260/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/10260/events","html_url":"https://github.com/facebook/react-native/issues/10260","id":181254682,"number":10260,"title":"ScrollView is inconsistent in android on resume with keyboard open","user":{"login":"atlanteh","id":3952700,"avatar_url":"https://avatars0.githubusercontent.com/u/3952700?v=4","gravatar_id":"","url":"https://api.github.com/users/atlanteh","html_url":"https://github.com/atlanteh","followers_url":"https://api.github.com/users/atlanteh/followers","following_url":"https://api.github.com/users/atlanteh/following{/other_user}","gists_url":"https://api.github.com/users/atlanteh/gists{/gist_id}","starred_url":"https://api.github.com/users/atlanteh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlanteh/subscriptions","organizations_url":"https://api.github.com/users/atlanteh/orgs","repos_url":"https://api.github.com/users/atlanteh/repos","events_url":"https://api.github.com/users/atlanteh/events{/privacy}","received_events_url":"https://api.github.com/users/atlanteh/received_events","type":"User","site_admin":false},"labels":[{"id":260305031,"url":"https://api.github.com/repos/facebook/react-native/labels/Android","name":"Android","color":"bfe5bf","default":false},{"id":470317962,"url":"https://api.github.com/repos/facebook/react-native/labels/Icebox","name":"Icebox","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-05T20:17:13Z","updated_at":"2017-07-20T22:44:04Z","closed_at":null,"body":"### Issue Description\n\nAs I understand, it's the App's responsibility to handle the keyboard events and to add padding\\margin if the keyboard is open, and remove it when the keyboard is dismissed, and this seems to be the regular case for my ScrollView. However, when pressing the home button when the keyboard is open and then returning to the app, the ScrollView suddenly shrinks to the space left.\nWhen combined with keyboardDidShow & keyboardDidHide this results in The margin of the keyboard height being shown on top of the keyboard.\n### Steps to Reproduce / Code Snippets\n\nCode:\n\n``` jsx\nimport React from 'react';\nimport { View, Keyboard, TextInput, ScrollView } from 'react-native';\n\nexport default class App extends React.Component {\n    constructor(props) {\n        super(props);\n        this.state = {};\n    }\n\n    componentWillMount() {\n        // const handleKeyboardVisible = (e) => this.setState({keyboardHeight: e.endCoordinates.height});\n        // const handleKeyboardHidden = () => this.setState({keyboardHeight: 0});\n        // this.keyboardShowListener = Keyboard.addListener('keyboardDidShow', handleKeyboardVisible);\n        // this.keyboardHideListener = Keyboard.addListener('keyboardDidHide', handleKeyboardHidden);\n    }\n\n    componentWillUnmount() {\n        // this.keyboardShowListener.remove();\n        // this.keyboardHideListener.remove();\n    }\n\n    render() {\n        const {keyboardHeight} = this.state;\n        return (\n            <ScrollView style={{flex: 1, marginBottom: keyboardHeight, backgroundColor: 'orange'}} keyboardShouldPersistTaps>\n                <View>\n                    <TextInput style={{backgroundColor: 'green', marginBottom: 360}} />\n                    <View style={{backgroundColor: 'red', alignSelf: 'stretch', height: 200}} />\n                </View>\n            </ScrollView>\n        );\n    }\n}\n\n```\n\nStep 1:\nThis is a simple ScrollView with a TextInput at the top & a red view at the bottom\n![screenshot_2016-10-05-22-47-39](https://cloud.githubusercontent.com/assets/3952700/19129256/5099d050-8b4f-11e6-81a6-67bb87a4306e.png)\n\nWhen opening the keyboard, The ScrollView ignores the keyboard so you can't Scroll to the red View:\n![screenshot_2016-10-05-22-47-47](https://cloud.githubusercontent.com/assets/3952700/19129282/7262624c-8b4f-11e6-9a7d-ae8d2b32e56e.png)\n\nAfter pressing the Android home button & then returning back to the app, suddenly you can Scroll to the red View\n![screenshot_2016-10-05-22-47-57](https://cloud.githubusercontent.com/assets/3952700/19129312/9923dc4e-8b4f-11e6-8e6c-39b4ef7c093d.png)\n\nIf you uncomment componentWillMount & componentWillUnnmount then the ScrollView does avoid the keyboard height. But then when pressing home button and returning, a keyboard size white screen shows up:\n![screenshot_2016-10-05-22-48-27](https://cloud.githubusercontent.com/assets/3952700/19129623/a4c7fa2a-8b50-11e6-8f3a-4d20746f7838.png)\n\nI tried reverting all the way to react-native@0.30.0 and it's all the same.\n#### Expected Results\n\nThe ScrollView should ignore the keyboard even after app resume.\n### Additional Information\n- React Native version: 0.34.1\n- Platform(s) (iOS, Android, or both?): Android\n- Operating System (macOS, Linux, or Windows?): Windows\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/316851094","html_url":"https://github.com/facebook/react-native/issues/10260#issuecomment-316851094","issue_url":"https://api.github.com/repos/facebook/react-native/issues/10260","id":316851094,"user":{"login":"hramos","id":165856,"avatar_url":"https://avatars3.githubusercontent.com/u/165856?v=4","gravatar_id":"","url":"https://api.github.com/users/hramos","html_url":"https://github.com/hramos","followers_url":"https://api.github.com/users/hramos/followers","following_url":"https://api.github.com/users/hramos/following{/other_user}","gists_url":"https://api.github.com/users/hramos/gists{/gist_id}","starred_url":"https://api.github.com/users/hramos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hramos/subscriptions","organizations_url":"https://api.github.com/users/hramos/orgs","repos_url":"https://api.github.com/users/hramos/repos","events_url":"https://api.github.com/users/hramos/events{/privacy}","received_events_url":"https://api.github.com/users/hramos/received_events","type":"User","site_admin":false},"created_at":"2017-07-20T22:44:04Z","updated_at":"2017-07-20T22:44:04Z","body":"Hi there! This issue is being closed because it has been inactive for a while.\n\nBut don't worry, it will live on with Canny! Check out its new home: https://react-native.canny.io/feature-requests/p/scrollview-is-inconsistent-in-android-on-resume-with-keyboard-open\n"}}
{"actor":{"display_login":"hramos"}}