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

[Android] makeImageFromView takes a snapshot of the flatlist, the result has padding on it #2063

Closed
Rakha112 opened this issue Dec 15, 2023 · 6 comments · Fixed by #2306
Closed
Labels
bug Something isn't working

Comments

@Rakha112
Copy link

Rakha112 commented Dec 15, 2023

Description

Hey, When I try to take a snapshot of a View that has a Flatlist using makeImageFromView, if I scroll down the Flatlist, then take a snapshot, the result of the snapshot will have padding on it, this happens only on Android works fine on iOS.
Please see the GIF below
Thank You

Demo

Version

0.1.229

Steps to reproduce

  1. Clone the Repo
  2. Run The App
  3. Scroll then press the SNAPSHOT button
  4. See the snapshot result

Snack, code example, screenshot, or link to a repository

https://github.com/Rakha112/BugMakeImageFromView

@Rakha112 Rakha112 added the bug Something isn't working label Dec 15, 2023
@TrevPennington
Copy link

Experiencing this as well

@louix
Copy link
Contributor

louix commented Jan 17, 2024

This might be down to how a FlatList renders on React Native. It's derived from VirtualizedList, which as they say in the docs:

Virtualization massively improves memory consumption and performance of large lists by maintaining a finite render window of active items and replacing all items outside of the render window with appropriately sized blank space

@Rakha112
Copy link
Author

Hey @louix thank you for your explanation. So, is this the expected behavior ? And is there a workaround for it?

@Nodonisko
Copy link
Contributor

The underlying problem is not attributed to padding but to snapshots being captured from the top part of the FlatList, which may have already unmounted some components due to scroll offset. Should be solved by #2306

@Rakha112
Copy link
Author

Hey @Nodonisko, thank you for your explanation. I hope that PR will be included in the next release. Thank you very much.

@Rakha112
Copy link
Author

Rakha112 commented Apr 3, 2024

Hey @Nodonisko, after updating Skia to version 1.0.5, this issue has been fixed. Thank you very much.

@Rakha112 Rakha112 closed this as completed Apr 3, 2024
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.

4 participants