prscX / react-native-bottom-action-sheet

React Native: Native Bottom Action Sheet
Apache License 2.0
634 stars 48 forks source link

iOS GridView item array out of bound #22

Closed rheng001 closed 6 years ago

rheng001 commented 6 years ago

Hey @prscX

There is a problem regarding the item array when dealing with the ios GridView.

simulator_screen_shot_-_iphone_6_-_2018-07-19_at_11 39 48

I receive this error, because from my first issue https://github.com/prscX/react-native-bottom-action-sheet/issues/21 the Chinese cancel button is still taking up the item array[0] position. My Food Truck object should be items[0] but it is still considered to be items[1] and gives me errors.

simulator_screen_shot_-_iphone_6_-_2018-07-19_at_11 13 56

I see from your code from https://github.com/prscX/SGActionView/commit/d3edaf178de6f7281c26533683bf388612e4019f#diff-2cbd6bf6bd77be3bcd32e9a084a4a0c6 you have removed the button view but maybe not actual button implementation into the array.

I think I have found the lines that you need to remove. The cancel button that you commented out from has the following code https://github.com/prscX/SGActionView/blob/d3edaf178de6f7281c26533683bf388612e4019f/SGActionView/SGGridMenu.m#L94-L96

I dont know much about the native swift code but could these lines be still associated with the cancel_button that you commented out? https://github.com/prscX/SGActionView/blob/d3edaf178de6f7281c26533683bf388612e4019f/SGActionView/SGGridMenu.m#L123-L126

The cancel button is still being created functionally somewhere in the code and still being added to the item array here with items[0]

prscX commented 6 years ago

Thanks @rheng001 for raising the issue.

I have fix and pushed a release V0.0.17 with the same. Can you please install latest version and verify the same.

Please let me know incase you still face the same issue.

Thanks </ Pranav >