Repository navigation
London | 26-ITP-Sep | Bartosz Kawiak | Sprint 2 | Debugging - #602
bartoszkawiak wants to merge 3 commits into
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
Can you check if any of this general feedback can help you further improve your code?
https://github.com/CodeYourFuture/Module-Data-Flows/blob/general-review-feedback/debugging/book-library/feedback.md
Doing so can help me speed up the review process. Thanks.
| id="author" | ||
| name="author" | ||
| required | ||
| /> | ||
| <label for="pages">Pages:</label> | ||
| <input | ||
| type="number" | ||
| min="1" |
There was a problem hiding this comment.
Could you find out why the constraints such such as required and min="1" are not enforced by the browser?
Note: The alert dialog box is produced by the script and not because of the browser enforcing the constraints.
There was a problem hiding this comment.
Thanks CJ, The inputs were inside a div instead of a form, and I was calling the submit function directly using onclick. I've replaced the div with a form and added a submit event listener
There was a problem hiding this comment.
I had a look at the guidelines and made adjustments. Thank you CJ
|
Have you followed the link of the general feedback I shared with you in the previous comment and gone through it? |
cjyuan
left a comment
There was a problem hiding this comment.
Changes look great. Well done!
| window.addEventListener("load", function () { | ||
| populateStorage(); | ||
| render(); | ||
| }); | ||
|
|
||
| form.addEventListener("submit", function (event) { | ||
| event.preventDefault(); | ||
| submit(); | ||
| }); |
There was a problem hiding this comment.
Note: Code on lines 14-17 is also "code to be executed once on page load". So you could consider placing the the code within the window's onload callback function on lines 10-12.
| render(); | ||
| alert(`You've deleted title: ${deletedTitle}`); |
There was a problem hiding this comment.
Note: alert() is a blocking function call. As a result, even if it is invoked after calling render(), it will still prevent the browser from updating the UI until the dialog is dismissed.
If time permits, research for approaches that allows the UI to update before displaying the alert dialog. (This is an optional change).
Learners, PR Template
Self checklist
Task code
CYF-1122
Changelist
Bugs fixed in script.js, index.html also checked with lighthouse and styling was adjusted.