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

Swapping does not work with duplicate images #13

Open
lukebrandonfarrell opened this issue Feb 23, 2019 · 0 comments
Open

Swapping does not work with duplicate images #13

lukebrandonfarrell opened this issue Feb 23, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@lukebrandonfarrell
Copy link
Contributor

Description

Swapping images does not work when there are multiple instances of the same image in the collage. This is because swapping uses the URL of the image for indexing, if there is a duplicate image, then two identical URLs exist in the images array and this will cause strange behaviour when swapping.

Solution

A possible solution would be to build a local state array from the images prop each with unique IDs, then use the unique ID to identify each image when swapping.

Steps to Reproduce

Build a collage with duplicate images.

swapping

@lukebrandonfarrell lukebrandonfarrell added the bug Something isn't working label Feb 23, 2019
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

1 participant