Skip to content

Autocomplete onSelectionChange fires two times when changing previously selected value #4094

Closed
@ShankarSumanth

Description

@ShankarSumanth

Bug:

If the autocomplete input field already has a value and this is changed by deleting the previous value and selecting a new option from the list, then the autocomplete's onSelectionChange fires twice.

What is the expected behavior?

When editing/ changing the previous selected value onSelectionChange should fire only once.

What is the current behavior?

When editing/ changing the previous selected value onSelectionChange fires twice

What are the steps to reproduce?

Step 1: Select a value from autocomplete dropdown
Step 2: Clear this value (use backspace/ select all and erase)
Step 3: Select a different value from the autocomplete

Providing a Plunker (or similar) is the best way to get the team to see your issue.
https://plnkr.co/edit/cOYg48HGf86ZtG0fO59r?p=preview

What is the use-case or motivation for changing an existing behavior?

When you want to edit a pre-filled value or you selected a value by mistake and want to make a change and if there are other fields dependent on this value, then the dependent values don't get updated.

Which versions of Angular, Material, OS, browsers are affected?

"@angular/material": "^2.0.0-beta.3"
OS: Mac
browser: Chrome/ Safari

Is there anything else we should know?

Nope.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions