{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/16751","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/16751/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/16751/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/16751/events","html_url":"https://github.com/facebook/react-native/issues/16751","id":272155540,"number":16751,"title":"Flatlist item onPress not fired during timer's setInterval function","user":{"login":"malonguwa","id":2183780,"avatar_url":"https://avatars0.githubusercontent.com/u/2183780?v=4","gravatar_id":"","url":"https://api.github.com/users/malonguwa","html_url":"https://github.com/malonguwa","followers_url":"https://api.github.com/users/malonguwa/followers","following_url":"https://api.github.com/users/malonguwa/following{/other_user}","gists_url":"https://api.github.com/users/malonguwa/gists{/gist_id}","starred_url":"https://api.github.com/users/malonguwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malonguwa/subscriptions","organizations_url":"https://api.github.com/users/malonguwa/orgs","repos_url":"https://api.github.com/users/malonguwa/repos","events_url":"https://api.github.com/users/malonguwa/events{/privacy}","received_events_url":"https://api.github.com/users/malonguwa/received_events","type":"User","site_admin":false},"labels":[{"id":238473506,"url":"https://api.github.com/repos/facebook/react-native/labels/Needs%20more%20information","name":"Needs more information","color":"f7c6c7","default":false},{"id":337217254,"url":"https://api.github.com/repos/facebook/react-native/labels/Ran%20Commands","name":"Ran Commands","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-08T10:55:11Z","updated_at":"2017-11-08T11:00:10Z","closed_at":null,"author_association":"NONE","body":"I am using FlatList to implement a carousel, and I try to use timer to increase the FlatList's offset.X, and makes it auto scrolling. But my FlatList item's TouchableOpacity onPress function never fire during the timer setInterval function which increasing the FlatList's offset.X every seconds. The Item's onPress works fine without start the timer up.\r\n\r\nMay I ask is there anything wrong for my implement? How should I implement the carousel with FlatList auto scrolling and the Item can be clicked during the scrolling?\r\n\r\nThis is the code for my FlatList and ListItem:\r\n```\r\n <FlatList\r\n              ref={(ref) => { this.flatListRef = ref; }}\r\n              horizontal = {true}\r\n              data={this.state.dataForCarousel}\r\n              renderItem={this._renderItem}\r\n              onScroll={this.handleScroll}\r\n >\r\n </FlatList>\r\n\r\n  _renderItem = (item) => {\r\n    let item1 = item;\r\n    var txt = item1.item;\r\n    var bgColor = item1.index % 2 == 0 ? 'red' : 'yellow';\r\n    return (\r\n        <TouchableOpacity\r\n            onPress={this.clickItem}\r\n        >\r\n          <View\r\n              style={{ flex: 1, alignItems: \"center\", justifyContent: \"center\",backgroundColor: bgColor, width: 80 }}>\r\n            <Text>{txt}</Text>\r\n          </View>\r\n        </TouchableOpacity>\r\n    )\r\n  }\r\n```         \r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nHere is my Timer function in componentDidMount:\r\n``` \r\n      this.timer = setInterval(() => {\r\n          this.flatListRef.scrollToOffset({ offset: this.scrollX+5});\r\n      }, 100);\r\n\r\n```\r\n\r\n\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/342783722","html_url":"https://github.com/facebook/react-native/issues/16751#issuecomment-342783722","issue_url":"https://api.github.com/repos/facebook/react-native/issues/16751","id":342783722,"user":{"login":"facebook-github-bot","id":6422482,"avatar_url":"https://avatars3.githubusercontent.com/u/6422482?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook-github-bot","html_url":"https://github.com/facebook-github-bot","followers_url":"https://api.github.com/users/facebook-github-bot/followers","following_url":"https://api.github.com/users/facebook-github-bot/following{/other_user}","gists_url":"https://api.github.com/users/facebook-github-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook-github-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook-github-bot/subscriptions","organizations_url":"https://api.github.com/users/facebook-github-bot/orgs","repos_url":"https://api.github.com/users/facebook-github-bot/repos","events_url":"https://api.github.com/users/facebook-github-bot/events{/privacy}","received_events_url":"https://api.github.com/users/facebook-github-bot/received_events","type":"User","site_admin":false},"created_at":"2017-11-08T11:00:10Z","updated_at":"2017-11-08T11:00:10Z","author_association":"NONE","body":"Hey @malonguwa, thanks for posting this! It looks like your issue is missing some required information. Can you please add all the details specified in the [Issue Template](https://raw.githubusercontent.com/facebook/react-native/master/.github/ISSUE_TEMPLATE.md)? This is necessary for people to be able to understand and reproduce your issue. I am going to close this, but please feel free to open a new issue with the additional information provided. Thanks!<br/><br/><sub>[How to Contribute](https://facebook.github.io/react-native/docs/contributing.html#bugs) • [What to Expect from Maintainers](https://facebook.github.io/react-native/docs/maintainers.html#handling-issues)</sub>"}}
{"actor":{"display_login":"facebook-github-bot"}}