saleel / react-native-super-grid

Responsive Grid View for React Native
MIT License
1.43k stars 153 forks source link

Render issue when opened from background on iOS 15 #174

Closed markwindsorr closed 2 years ago

markwindsorr commented 3 years ago

UI will render incorrectly when app is reopened on iOS 15. Only way to get it back to normal is to kill the app and relaunch

Screen Shot 2021-08-25 at 1 38 05 PM

saleel commented 3 years ago

Is this happening only on iOS 15?

Please share screenshot of normal view. Also can you share your code here?

markwindsorr commented 3 years ago

It seems to happen 1 or 2 times out of 20 opens only on iOS 15


<FlatGrid
itemDimension={145}
data={chDevices}
extraData={refreshing}
renderItem={({ item }) => {
return (
<DeviceTile
state={states.byId[item.Id]}
height={170}
device={item}
sp={sp.byId[item.Id]}
reading={readings.byId[item.Id]}
ds={ds.byId[item.Id]}
/>
);
}}
enableEmptySections
style={{marginTop: -10}}
/>
saleel commented 3 years ago

I have not tried iOS 15 yet and am not sure what is the actual issue. If it is something affecting FlatList itself, upgrading RN version might help.

Also, Can you try adding flex: 1 to style prop. Can you try removing extraData={refreshing} and enableEmptySections

dhairyasenjaliya commented 2 years ago

hello guys seems this issue effected our app as well any solution for iOS 15 is only has this issue ? it seems like general react / iOS issue not for this package

saleel commented 2 years ago

@dhairyasenjaliya I am not sure I fully understand. Do you have layout issues when you re-open app with FlatGrid in iOS 15? It it only happening in iOS 15? And have you noticed this issue in other apps well?

If this is a confirmed case happening only to FlatGrid, one solution would be to listen to AppState change and force a re-layout by calling onLayoutLocal. You can try this and see if it solves the issue.

RalissonMattias commented 2 years ago

I have the same problem on android, it happens when I navigate between screens in my navigation bar

saleel commented 2 years ago

@RalissonMattias can you try my suggestion above? Please take a fork of this repo and try.

RalissonMattias commented 2 years ago

In my case, it happens when I move through screens

dhairyasenjaliya commented 2 years ago

Solution: Upgrade React version to 0.67 or newer