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

column span of the item is incorrect #874

Closed
2 tasks
NemoDream opened this issue Jul 13, 2023 · 2 comments
Closed
2 tasks

column span of the item is incorrect #874

NemoDream opened this issue Jul 13, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@NemoDream
Copy link

NemoDream commented Jul 13, 2023

Current behavior

When overrideItemLayout is used to change the column span, the column span of the item is different, and the device screen direction is switched, the column span of the item is incorrect.
https://snack.expo.dev/@nemo0625/flashlist-screen-orientation-switch-bug

SVID_20230713_174937_1.mp4

Expected behavior

the column span of the item is normal.
截图

To Reproduce

Just switch screen direction.

Platform:

  • iOS
  • Android

Environment

@shopify/flash-list 1.4.3

@NemoDream NemoDream added the bug Something isn't working label Jul 13, 2023
@adesugbaa
Copy link

I have the same issue - glitchy performance when numColumns > 1, and device rotated or window resized. 1st row typically has 2nd column missing, other times 2nd column overlaps 1st column.

Completely unusable.

@naqvitalha
Copy link
Collaborator

naqvitalha commented Mar 20, 2024

In case of orientation changes it's important to ensure that component updates. Also, clearing the layout cache will help. Use the following code with latest FlashList:

  const {height, width} = useWindowDimensions()
  useLayoutEffect(() => {
      flashListRef.current?.clearLayoutCacheOnUpdate();
  },[height > width])

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

No branches or pull requests

3 participants