Noticed strange behavior with the completed project code, just wanted to submit it to see if it might be worth looking at. Also, I’m not sure if this post would be better placed in the Support category or here in Javascript…
Project link:
The “add or update task button” text content does not properly display “add task” when clicking “add new task” AFTER canceling the update of a task - instead reading “update task”
Steps to reproduce:
- Click “Add new task” and add any task details.
- Submit by clicking “Add task”.
- Click “Edit” to open the update form.
- Close the update form.
- Click “Add new task”.
- OBSERVE: Submit button reads “Update task”.
- EXPECTED: Submit button reads “Add task”.
This also reproduces if you make changes to your task and then click “Discard”. - Click “Edit” to open the update form.
- Make any changes to the task.
- Attempt to close the task form.
- Select “Discard” from the modal.
This is seemingly resolved when adding the following line to the Event listener callback functions on closeTaskFormBtn (line: 105) and discardBtn (line: 114).
addOrUpdateTaskBtn.innerText = "Add Task";