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

upload-section deleted image gets added to the canvas. #46

Open
MichaelDimmitt opened this issue Sep 28, 2024 · 0 comments · May be fixed by #47
Open

upload-section deleted image gets added to the canvas. #46

MichaelDimmitt opened this issue Sep 28, 2024 · 0 comments · May be fixed by #47

Comments

@MichaelDimmitt
Copy link

MichaelDimmitt commented Sep 28, 2024

Issue:

upload-section adds an image to the canvas when deleting.

Expected:

Image should be deleted and no image added to the canvas.

Note:

If people agree this is an issue.
I submitted a pr to resolve this issue #47. I had to solve this in my own project so I thought id submit the solution for others to benefit. Happy to have further discussion if you have any questions / concerns.

Why:

ImagesGrid, registers the function getCredit first and does the delete action. Next, ImagesGrid - onSelect is activated which adds an element to the canvas via addElement.

There is nothing in the callback parameters for either function getCredit nor onSelect that can identify that a delete has occurred instead of a select. getCredit's buttonClick property: event.nativeEvent.preventDefaulthas no effect on onSelect.

Steps to reproduce:

src/sections/upload-section.js

Uncommenting the following line in App.js:
DEFAULT_SECTIONS.unshift(UploadSection);

add import {UploadSection} from './sections/upload-section' to the top of App.js

Video of issue: (deleted image is added to the canvas)

delete-incorrectly-loads-image.mov

Video with solution: (deleted image does not get added to the canvas)

fixed.mov

Cheers,
Michael Dimmitt

@MichaelDimmitt MichaelDimmitt changed the title upload-section delete functionality incorrectly adds an image to the canvas. upload-section deleted image gets added to the canvas. Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant