Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug][ios]: using getItemType causes blanks and overlapping items #600

Closed
1 of 2 tasks
hirbod opened this issue Sep 14, 2022 · 8 comments · Fixed by #788
Closed
1 of 2 tasks

[bug][ios]: using getItemType causes blanks and overlapping items #600

hirbod opened this issue Sep 14, 2022 · 8 comments · Fixed by #788
Labels
bug Something isn't working

Comments

@hirbod
Copy link
Contributor

hirbod commented Sep 14, 2022

Current behavior

Using getItemType causes blanks and overlapping items.

I reproduced a bug where using getItemType causes blanks and overlapping items. This does only happen when using different types but the elements having the same height. In my Expo Snack, just using two types (e.g "header" and "row" does not break), since header and row have different heights. But I used different types (in my real app) because the items have different icons and styling, so I tried to add more types in order to optimize renders. While I could just use two types to "fix" this issue, getItemType should never cause this blanks, even when the items have the same height.

RPReplay_Final1663187328.mp4

Bildschirmfoto_2022-09-14_um_21 54 43

I was only able to reproduce this on iOS, but honestly haven't tried android enough. It is not breaking on web.

Expected behavior

Should not cause blanks and overlapping items

To Reproduce

https://snack.expo.dev/@hirbod/getitemtype-failing

Platform:

  • iOS
  • Android

Environment

Happens on iOS (bare react-native and expo, 1.1.0 and 1.2.1)

@hirbod hirbod added the bug Something isn't working label Sep 14, 2022
@naqvitalha
Copy link
Collaborator

@hirbod I looked into this and it seems like getItemType is returning a random value in the sample. Are you able to reproduce if you don't return something random?

@hirbod
Copy link
Contributor Author

hirbod commented Sep 21, 2022

@naqvitalha yes, I am able to reproduce this. The random value was only for demonstration. It also happens when I just have 2 different types. (like in my app)

It does not happen when both types have different dimensions, only when you have different types with same item dimensions - at least thats my guess.

@hirbod
Copy link
Contributor Author

hirbod commented Sep 29, 2022

@naqvitalha we had reports in the Discord group that this issue can even randomly occur even without the use of getItemType. So it just might be a coincidence or there is a general issue that can happen

@BalogunofAfrica
Copy link

Hi @hirbod what did you do to fix this? Currently experiencing this in our app

@hirbod
Copy link
Contributor Author

hirbod commented Jan 13, 2023

For me the only fix was to omit getItemType

@chrisnojima
Copy link

Hey,
I'm working through similar issues and have a workaround that I'm working on here: https://github.com/keybase/client/pull/25431/files#diff-f67a7205112c41c7aafa06a4bcd839cb2918b1c922d5297fab63a0a4b84a224b maybe it'll be useful and maybe it could be applied upstream

@naqvitalha
Copy link
Collaborator

I think we have finally figured this out. More updates soon. This was a tough one.

@singhayush1403
Copy link

Is this fixed? Still happening with me on version 1.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants