{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/18221","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/18221/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/18221/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/18221/events","html_url":"https://github.com/facebook/react-native/issues/18221","id":302622440,"node_id":"MDU6SXNzdWUzMDI2MjI0NDA=","number":18221,"title":"TextInput order of events are inconsistent between iOS and Android","user":{"login":"lxcid","id":297156,"node_id":"MDQ6VXNlcjI5NzE1Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/297156?v=4","gravatar_id":"","url":"https://api.github.com/users/lxcid","html_url":"https://github.com/lxcid","followers_url":"https://api.github.com/users/lxcid/followers","following_url":"https://api.github.com/users/lxcid/following{/other_user}","gists_url":"https://api.github.com/users/lxcid/gists{/gist_id}","starred_url":"https://api.github.com/users/lxcid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxcid/subscriptions","organizations_url":"https://api.github.com/users/lxcid/orgs","repos_url":"https://api.github.com/users/lxcid/repos","events_url":"https://api.github.com/users/lxcid/events{/privacy}","received_events_url":"https://api.github.com/users/lxcid/received_events","type":"User","site_admin":false},"labels":[{"id":337217254,"node_id":"MDU6TGFiZWwzMzcyMTcyNTQ=","url":"https://api.github.com/repos/facebook/react-native/labels/Ran%20Commands","name":"Ran Commands","color":"ffffff","default":false},{"id":1056126664,"node_id":"MDU6TGFiZWwxMDU2MTI2NjY0","url":"https://api.github.com/repos/facebook/react-native/labels/%F0%9F%94%B6Components","name":"🔶Components","color":"fef2c0","default":false},{"id":869668024,"node_id":"MDU6TGFiZWw4Njk2NjgwMjQ=","url":"https://api.github.com/repos/facebook/react-native/labels/%F0%9F%94%B6TextInput","name":"🔶TextInput","color":"fef2c0","default":false},{"id":870851515,"node_id":"MDU6TGFiZWw4NzA4NTE1MTU=","url":"https://api.github.com/repos/facebook/react-native/labels/%F0%9F%94%B7Android","name":"🔷Android","color":"bfd4f2","default":false},{"id":257497884,"node_id":"MDU6TGFiZWwyNTc0OTc4ODQ=","url":"https://api.github.com/repos/facebook/react-native/labels/%F0%9F%94%B7iOS","name":"🔷iOS","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-06T09:24:44Z","updated_at":"2018-11-14T21:18:48Z","closed_at":null,"author_association":"NONE","body":"TextInput event order are different for iOS and Android.\r\n\r\nThis inconsistency make certain operations hard to archive on Android:\r\n\r\n- Detect backspace key on empty text input to delete the component. If only 1 character is left in the text, pressing backspace key will delete the text first before we process which key is pressed, which will make us assume that the text input is empty.\r\n- Processing text on `change text event` before `selection change event` can cause crash due to invalid selection.\r\n\r\n### Environment\r\n\r\nTested on Expo 25.0.0/0.52.0, but original issue happen in 0.53.3 as well, Likely exist in 0.54.0\r\n\r\n### Expected Behavior\r\n\r\nI think iOS order of events make the most sense and I hope Android can follow the suit.\r\n\r\n### Actual Behavior\r\n\r\nThe event in question are `onChangeText()`, `onSelectionChange()` and `onKeyPress()`.\r\n\r\nOn iOS, the events are in the following order:\r\n\r\n- key press\r\n- selection change\r\n- change text\r\n\r\n![screenshot 2018-03-06 17 12 21](https://user-images.githubusercontent.com/297156/37023691-a864f66c-2161-11e8-92e9-8722786caa6d.png)\r\n\r\nOn Android, the events are in the following order:\r\n\r\n- change text\r\n- selection change\r\n- onKeyPress (See #18262)\r\n\r\n![screenshot 2018-03-06 17 12 27](https://user-images.githubusercontent.com/297156/37023674-a0797cb6-2161-11e8-8d87-85c752aa5fe5.png)\r\n\r\n### Steps to Reproduce\r\n\r\nhttps://snack.expo.io/Hk2qtCouf"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/438822303","html_url":"https://github.com/facebook/react-native/issues/18221#issuecomment-438822303","issue_url":"https://api.github.com/repos/facebook/react-native/issues/18221","id":438822303,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODgyMjMwMw==","user":{"login":"rickysullivan","id":437480,"node_id":"MDQ6VXNlcjQzNzQ4MA==","avatar_url":"https://avatars3.githubusercontent.com/u/437480?v=4","gravatar_id":"","url":"https://api.github.com/users/rickysullivan","html_url":"https://github.com/rickysullivan","followers_url":"https://api.github.com/users/rickysullivan/followers","following_url":"https://api.github.com/users/rickysullivan/following{/other_user}","gists_url":"https://api.github.com/users/rickysullivan/gists{/gist_id}","starred_url":"https://api.github.com/users/rickysullivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickysullivan/subscriptions","organizations_url":"https://api.github.com/users/rickysullivan/orgs","repos_url":"https://api.github.com/users/rickysullivan/repos","events_url":"https://api.github.com/users/rickysullivan/events{/privacy}","received_events_url":"https://api.github.com/users/rickysullivan/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T21:18:48Z","updated_at":"2018-11-14T21:18:48Z","author_association":"NONE","body":"Does anyone have a workaround?"}}
{"actor":{"display_login":"rickysullivan"}}