-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix Dynamic Update of Autocomplete Dropdown in Search Component #173
Conversation
Fixed an issue where the autocomplete dropdown in the Search component was not updating correctly with user input. The dropdown now dynamically updates with search results as the user types, reflecting successful backend API responses. This fix involved disabling the built-in filtering of the Autocomplete component, as per MUI documentation guidelines, to allow for better handling of dynamic search results. Issue: #171 Signed-off-by: Nikolay Martyanov <[email protected]>
WalkthroughThe update to the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ? TipsChat with CodeRabbit Bot (
|
Apply Sweep Rules to your PR?
Type can be one of the following:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (1)
- frontend/src/components/Search.jsx (2 hunks)
Additional comments: 2
frontend/src/components/Search.jsx (2)
120-120: The
filterOptions
prop is set to a function that returns the options as they are, effectively disabling the default filtering. This change aligns with the MUI documentation for handling dynamic search results.163-167: The
inputValue
state is being set directly from thenewInputValue
parameter, andsearchTerm
is updated accordingly. This change should ensure that the dropdown updates dynamically with the search results as the user types, which addresses the issue reported in issue Dropdown Not Showing on Continued Typing in Search Autocomplete #171.
Description
This PR addresses an issue with the autocomplete dropdown in the Search component. Previously, the dropdown was not dynamically updating with user input, failing to reflect the successful API responses. The changes made ensure that as the user types, the dropdown dynamically updates with search results. This fix involves disabling the built-in filtering of the Autocomplete component, following MUI documentation guidelines, to enhance the handling of dynamic search results.
Related Issues
Closes: #171
How Was This Tested?
The changes were tested by simulating user input in the search field and observing the behavior of the autocomplete dropdown. The dropdown now correctly updates with each keystroke, displaying relevant search results based on the backend API responses.
Checklist
Before submitting your PR, please review the following:
Additional Comments (if any):
This fix enhances the user experience by providing real-time, accurate search results, making the search functionality more intuitive and responsive.
Summary by CodeRabbit
New Features
Autocomplete
component with afilterOptions
prop to improve search result filtering.Bug Fixes
inputValue
andsearchTerm
to ensure consistent and accurate search experiences without unnecessary matching against regions.