Skip to content

Handle scaling/translating item component #789

@mexysfr

Description

@mexysfr

Current behavior

Hello,

I've noticed a strange behavior when using a pinch gesture detector with Flashlist (which is using recyclerlistview under the hood).

The items in my list are simple: a header, an image and a footer.

The image is wrapped in a <SnapbackZoom> component from this lib, simply responsible for listening on a pinch event and then scaling and translating that image during the pinch.

In a random way, when a first image is zoomed, the size of a second image considered by the Flashlist a little further down the list is for some reason increased.
This behavior persists even when the second image is removed from the viewport.

By reloading the list (reloading the application), the second image returns to its original size, until the first image is zoomed in again.
I believe it's a recycling configuration but I can't find the answer.

Expected behavior

When an image is zoomed (scale, translate X, translate Y), the size of the other images in the list should not change.

To Reproduce

A repo with a very simple minimal example to reproduce is available here : https://github.com/mexysfr/pinch-zoom
I've also added a video demonstration of the bug below :
https://github.com/user-attachments/assets/ca71c49a-3fcd-4963-ac33-2a644a435404

Platform:

  • iOS
  • Android

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions