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

fix: repeated label removed from file on change click bug #2443

Conversation

Mike-Heneghan
Copy link
Contributor

@Mike-Heneghan Mike-Heneghan commented Nov 17, 2023

What

  • Update the modal component so that for each instance of the SelectMultiple component the previousTags are previous state or the initialTags on first render
  • Updates are checked but an update isn't applied as the previousTags = intialTags

Why

  • When the modal is rendered when there are two files it renders two SelectMultiple components and they were incorrectly updating the fileList as the previousTags variable was undefined
  • Therefore the uploaded file was effectively being removed from the slots.

Screen recordings

Bug

Screen.Recording.2023-11-17.at.17.33.00.mov

Fix

Screen.Recording.2023-11-17.at.17.36.40.mov

- When the modal was rendered it was incorrectly updating the fileList as the previousTags variable was undefined.
- The update function only ever applies a tag to a single file so the second file was not being tagged.
- Set the previousTags to the last state or the initialTags on first render
- Updates are checked but an update isn't applied as the previousTags = intialTags
@Mike-Heneghan Mike-Heneghan self-assigned this Nov 17, 2023
@Mike-Heneghan Mike-Heneghan requested a review from a team November 17, 2023 17:56
Copy link

github-actions bot commented Nov 17, 2023

Removed vultr server and associated DNS entries

Copy link
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is super clear and helpful thanks!

Appreciate you getting to the bottom of this one 💪

@Mike-Heneghan Mike-Heneghan merged commit 56a493f into main Nov 20, 2023
12 checks passed
@Mike-Heneghan Mike-Heneghan deleted the mh/upload-and-label-change-button-disappearing-duplicate-label-bug branch December 13, 2023 11:23
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 this pull request may close these issues.

2 participants