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

fix(material/autocomplete): ensure selected option updates correctly on backspace #30074

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IamFlok
Copy link

@IamFlok IamFlok commented Nov 25, 2024

Bug: Select an option from the autocomplete and close it. The input field is updated accordingly. Then click inside the input field and press backspace to update the input's value. The autocomplete panel opens, but the selected option is not updated yet. Pressing another backspace triggers the update.

Problem and fix:
When the _handleInput function is called, panelOpen is still false, causing the selected option to not update correctly. The _openPanelInternal function needs to be called to ensure the panel is open before processing the selected option logic.

…on backspace

Bug: Select an option from the autocomplete and close it. The input field is updated accordingly. Then click inside the input field and press backspace to update the input's value. The autocomplete panel opens, but the selected option is not updated yet. Pressing another backspace triggers the update.

Problem and fix:
When the `_handleInput` function is called, `panelOpen` is still `false`, causing the selected option to not update correctly. The `_openPanelInternal` function needs to be called to ensure the panel is open before processing the selected option logic.
@IamFlok IamFlok requested a review from a team as a code owner November 25, 2024 07:51
@IamFlok IamFlok requested review from crisbeto and amysorto and removed request for a team November 25, 2024 07:51
Copy link

google-cla bot commented Nov 25, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@IamFlok IamFlok marked this pull request as draft November 25, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant