Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete was implemented #763

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NazariiAlieksieiev
Copy link

Copy link

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

Choose a reason for hiding this comment

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

Great job on the implementation! 🎉 While there are a few minor naming convention issues and a potential performance consideration, they don't critically impact the functionality. Keep up the good work and consider the feedback for future improvements! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

</div>
<DropdownMenu
people={people}
onSelectedPerson={setSelectedPerson}

Choose a reason for hiding this comment

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

The prop 'onSelectedPerson' does not follow the recommended naming conventions for event handler functions in React. According to the checklist, it should be named using the 'handle' prefix, such as 'handleSelectedPerson'.

);

const handleInput = (event: React.ChangeEvent<HTMLInputElement>) => {
applyQuery(event.target.value);

Choose a reason for hiding this comment

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

The filter should not be called if the user enters spaces only. Consider trimming the input value and checking if it is not empty before calling applyQuery.

style={{ cursor: 'pointer' }}
className="dropdown-item"
data-cy="suggestion-item"
key={person.slug}

Choose a reason for hiding this comment

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

Generating keys during render can lead to performance issues and unexpected behavior. Ensure that the key is stable and unique for each item, and not generated dynamically during render.

[],
);

const handleInput = (event: React.ChangeEvent<HTMLInputElement>) => {

Choose a reason for hiding this comment

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

Consider following the naming conventions for event handler functions in React. For example, prefix the function name with 'handle' or 'on'.

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.

2 participants