Skip to content

MatAutocompleteTrigger optionSelections Observable stops working #14777

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

Closed
l10rdev opened this issue Jan 10, 2019 · 6 comments · Fixed by #14813
Closed

MatAutocompleteTrigger optionSelections Observable stops working #14777

l10rdev opened this issue Jan 10, 2019 · 6 comments · Fixed by #14813
Assignees
Labels
area: material/autocomplete P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@l10rdev
Copy link

l10rdev commented Jan 10, 2019

What is the expected behavior?

The AutocompleteTrigger.optionSelections Observable emits the value of the selected Element (and the counter increases).

What is the current behavior?

The AutocompleteTrigger.optionSelections Observable does not emit a new value.

What are the steps to reproduce?

https://stackblitz.com/edit/autocomplete-force-selection-4cyhez?file=app%2Fapp.component.ts

  1. Type 'Material' in the autocomplete field
  2. Delete it.
  3. Type 'Ma'
  4. Select 'Mary'

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

  • Angular Material: 7.21, 5,2,5 .

Is there anything else we should know?

This is also true for other AutocompleteTrigger Observables like panelClosingActions.

@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jan 10, 2019
@mmalerba
Copy link
Contributor

I don't think it's a bug with autocomplete, you just need to add markForCheck() after to trigger change detection to update the counter element: https://stackblitz.com/edit/autocomplete-force-selection-pv5wgb?file=app/app.component.ts

@l10rdev
Copy link
Author

l10rdev commented Jan 12, 2019

That does not solve the issue. Follow the steps I provided. If you type in 'Google' so there are no suggestions for autocomplete then delete everything again an chose an available option the counter does not increase.

@mmalerba
Copy link
Contributor

Ah I see, yes I am able to reproduce it. I will re-open this issue

@mmalerba mmalerba reopened this Jan 13, 2019
crisbeto added a commit to crisbeto/material2 that referenced this issue Jan 13, 2019
…ions changes

Fixes the `MatAutocompleteTrigger.optionSelections` stopping to emit when the list options has been swapped out.

Fixes angular#14777.
crisbeto added a commit to crisbeto/material2 that referenced this issue Feb 1, 2019
…ions changes

Fixes the `MatAutocompleteTrigger.optionSelections` stopping to emit when the list options has been swapped out.

Fixes angular#14777.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 16, 2019
…ions changes

Fixes the `MatAutocompleteTrigger.optionSelections` stopping to emit when the list options has been swapped out.

Fixes angular#14777.
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 30, 2019
…ions changes

Fixes the `MatAutocompleteTrigger.optionSelections` stopping to emit when the list options has been swapped out.

Fixes angular#14777.
@turulb
Copy link

turulb commented Mar 13, 2020

I've run into this problem with panelClosingActions, after upgrading angular/material to v9.
Will it be also fixed? If so when will it be released?

@DEG-7
Copy link

DEG-7 commented Apr 6, 2020

any news about it? thanks and regards

crisbeto added a commit to crisbeto/material2 that referenced this issue Aug 23, 2020
…ions changes

Fixes the `MatAutocompleteTrigger.optionSelections` stopping to emit when the list options has been swapped out.

Fixes angular#14777.
crisbeto added a commit to crisbeto/material2 that referenced this issue May 17, 2021
…st of options changes

Fixes the `MatAutocompleteTrigger.optionSelections` stopping to emit when the list options has been swapped out.

Fixes angular#14777.
andrewseguin pushed a commit that referenced this issue Jan 13, 2022
…st of options changes (#14813)

Fixes the `MatAutocompleteTrigger.optionSelections` stopping to emit when the list options has been swapped out.

Fixes #14777.
andrewseguin pushed a commit that referenced this issue Jan 13, 2022
…st of options changes (#14813)

Fixes the `MatAutocompleteTrigger.optionSelections` stopping to emit when the list options has been swapped out.

Fixes #14777.

(cherry picked from commit 3fd6f0e)
jeripeierSBB added a commit to sbb-design-systems/sbb-angular that referenced this issue Jan 17, 2022
…t of options changes

Fixes the `SbbAutocompleteTrigger.optionSelections` stopping to emit when
the list options has been swapped out.
angular/components#14777
jeripeierSBB added a commit to sbb-design-systems/sbb-angular that referenced this issue Jan 17, 2022
…t of options changes (#1033)

Fixes the `SbbAutocompleteTrigger.optionSelections` stopping to emit when
the list options has been swapped out.
angular/components#14777
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 13, 2022
forsti0506 pushed a commit to forsti0506/components that referenced this issue Apr 3, 2022
…st of options changes (angular#14813)

Fixes the `MatAutocompleteTrigger.optionSelections` stopping to emit when the list options has been swapped out.

Fixes angular#14777.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/autocomplete P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
6 participants