Skip to content

add task solution - #1972

Open
krivchenkov321-Serhii wants to merge 2 commits into
mate-academy:masterfrom
krivchenkov321-Serhii:develop
Open

krivchenkov321-Serhii wants to merge 2 commits into
mate-academy:masterfrom
krivchenkov321-Serhii:develop

Conversation

@krivchenkov321-Serhii

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your implementation has two critical issues that violate explicit task requirements. First, the placeholder text is not capitalized as required by the task description - you need to use a method like el.name.charAt(0).toUpperCase() + el.name.slice(1) to capitalize the first letter of the placeholder. Second, you're selecting inputs from the entire document with document.querySelectorAll('input') instead of getting them from the form element as specified in the requirements. Please fix both of these issues to meet the task specifications.


✨ 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

  1. Rate AI review example ↩

  2. Re-request AI review example ↩

  3. Add AI review comments example ↩

Comment thread src/scripts/main.js Outdated
el.parentElement.append(label);
});

inputs.forEach((el) => el.setAttribute('placeholder', el.name));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The placeholder text is not capitalized. The task requires 'Set placeholder text based on input name, capitalized'. Use a method like el.name.charAt(0).toUpperCase() + el.name.slice(1) to capitalize the first letter.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your code still has one critical blocker that must be fixed. You're using document.querySelectorAll('input') which selects all inputs from the entire document. The task explicitly requires getting inputs from the form element specifically: "Get all inputs from form tag on the page" using form.querySelectorAll('input').

To fix this, first select the form element (e.g., const form = document.querySelector('form')), then use form.querySelectorAll('input') to get only the inputs within that form. This is a core requirement that must be implemented correctly for the task to be considered complete.


✨ 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

  1. Rate AI review example ↩

  2. Re-request AI review example ↩

  3. Add AI review comments example ↩

Comment thread src/scripts/main.js
'use strict';

// write code here
const inputs = [...document.querySelectorAll('input')];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Select inputs from the form element instead of the entire document. Use document.querySelector('form').querySelectorAll('input') or get the form element first, then query its inputs.

@Anton-Kuchmasov Anton-Kuchmasov left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job!

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.

3 participants