Develop#1876
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation has a critical issue that must be fixed. The task requires appending label elements to the parent container of the input, but on line 19 you're using el.before(label), which inserts the label as a sibling element before the input rather than as a child of its parent container. This will cause test failures because the DOM structure doesn't match the requirement. To fix this, change el.before(label) to el.parentElement.append(label) or el.parentNode.appendChild(label). The rest of your implementation looks good—you've correctly created labels with proper attributes and capitalized placeholders.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
|
|
||
| el.placeholder = formattedName; | ||
|
|
||
| el.before(label); |
There was a problem hiding this comment.
The task description requires 'Append label elements to the parent container of the input'. Using el.before(label) inserts the label as a sibling before the input, not as a child of the parent container. Consider using el.parentElement.appendChild(label) to properly append the label to the parent container.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is approved. The critical issue has been resolved - labels are now correctly appended as children of the parent container using el.parentElement.append(label) instead of being inserted as sibling elements. All functional requirements are met: inputs are queried from the page, labels have the correct field-label class and for attribute matching the input id, textContent uses the input name, placeholders are properly capitalized, and labels are appended to the correct parent elements. Great work fixing that positioning issue!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
|
Why does almost every project in the DOM module trigger a merge conflict when creating a Pull Request? In previous modules, everything merged automatically. Is this a deliberate part of the curriculum designed to teach us how to handle such situations in real-world scenarios? |
https://pavlo111.github.io/js_task_fix_form_DOM/