While testing the edit avatar flow for android, I encountered this bug where the app crashes when the user presses anywhere outside the actionsheet. The reason for this is that the value of selectedIndex when a user tries to cancel on android is -1, and the value of selectedIndex when a user tries to cancel on iOS is 0. This is due to action sheets on android generally not having a cancel option in the sheet but there being a cancel option with iOS
Details
Details
- Reviewers
ashoat atul - Commits
- rCOMM39a557c86168: [native] fix Android cancel action sheet crash
No longer triggering the crash, and we are getting the expected cancel behavior. Also double checked that iOS still behaves as expected
Before:
After:
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
native/tooltip/tooltip-context.react.js | ||
---|---|---|
121–122 ↗ | (On Diff #25200) | We can't use !selectedIndex because this will evaluate to true when selectedIndex is equal to zero |