dsfai2020 / Task-and-Nutrition-Manager

An agile planning application that tracks tasks, ideas and nutrition goals. This app is designed to assist with everyday productivity, progress tracking and fitness.
1 stars 0 forks source link

local storage updates correctly on new ui creations for the description. But description doesn't update properly when editing an already created ui. #62

Open dsfai2020 opened 5 months ago

dsfai2020 commented 5 months ago

Describe the bug

Whenever I click on the Add another button it generates a new ui like id expect. Whatever I enter into the description text properly updates in the console log and on the local storage, letting me know that the states are working as intended. The problem is that after making multiple ui, if I try to edit a previously made ui it doesn't update that particular description field. Instead, it updates the the current/most recent ui's description field.

To Reproduce Steps to reproduce the behavior:

  1. Go to Add another
  2. Click on the button 3-4 times and give each their own description in the text entry. Then go back to any previous ui and edit the description.
  3. Scroll down to local storage
  4. See error the local storage isn't editing the state of the ui selected. Instead, it is editing the most recent ui description text.

Expected behavior Editing UI that's already been generated should update the state of that particular ui - specifically the description. The changes reflect properly on the UI themselves. But the local storage should also reflect these same changes. So that the state of each ui is stored properly even after having the descriptions changed.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context The variables inputValue is a state that pulls in the value of the description text. Then I use a stage variable to take the previous state of stageTest (which holds props as its value) and manually add in the props.description to the new stage using ...

Key variables to keep an eye on are stageTest stage And inputValue.

dsfai2020 commented 5 months ago

image This is still happening. I thought to create a NEW issue but it turns out that this may be tied directly to this issue...