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(select): emitting change event twice for reset values #13598

Merged

Conversation

crisbeto
Copy link
Member

Fixes mat-select emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers #10859 which would've introduced another issue.

Fixes #10675.
Fixes #13579.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Oct 13, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 13, 2018
@crisbeto crisbeto changed the title fix(select): emitting change even twice for reset values fix(select): emitting change event twice for reset values Oct 13, 2018
@crisbeto crisbeto force-pushed the 13579/select-reset-values-double-events branch from 5d1bb3c to f3120bf Compare October 13, 2018 05:30
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 16, 2018
@crisbeto crisbeto force-pushed the 13579/select-reset-values-double-events branch from f3120bf to 55dbbf4 Compare December 13, 2018 17:46
@crisbeto crisbeto force-pushed the 13579/select-reset-values-double-events branch from 55dbbf4 to 1dad2a8 Compare December 22, 2018 20:39
@hijamoya
Copy link

Anything make this pr can not be merged?

@jraadt
Copy link

jraadt commented Feb 20, 2019

Can this be merged?

@mmalerba mmalerba added aaa and removed aaa labels Apr 25, 2019
@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label May 30, 2019
@crisbeto crisbeto force-pushed the 13579/select-reset-values-double-events branch from 1dad2a8 to 51a8079 Compare June 19, 2019 20:37
@fouratachour
Copy link

Can this be merged PLZ !

@tobigit
Copy link

tobigit commented Aug 23, 2019

When this PR will be merged?

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround and removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Sep 27, 2019
@crisbeto
Copy link
Member Author

Bumping thing to a P2 since it keeps coming up.

@keatkeat87
Copy link

Why don't merge and fix the issue ?
this also will affect when we subscribe the value change like "this.formControl.valueChanges.subscribe()"
when user select null value, we get twice event fire.

@crisbeto crisbeto force-pushed the 13579/select-reset-values-double-events branch from 51a8079 to 863b61c Compare December 29, 2019 18:33
@jelbourn jelbourn added this to PRs in P2 PRs Jul 9, 2020
@andrewseguin andrewseguin moved this from PRs to In Progress in P2 PRs Jul 11, 2020
@andrewseguin
Copy link
Contributor

We're seeing internal failures and I believe I was able to reproduce the issue. See this PR for the failing test reproduction. In short, the select's value doesn't always match its form control's value. crisbeto#14

@crisbeto crisbeto force-pushed the 13579/select-reset-values-double-events branch 2 times, most recently from 5dfe4d2 to ce432f4 Compare July 21, 2020 20:36
@crisbeto
Copy link
Member Author

Updated to cover the extra test cases @andrewseguin.

Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers angular#10859 which would've introduced another issue.

Fixes angular#10675.
Fixes angular#13579.
@crisbeto crisbeto force-pushed the 13579/select-reset-values-double-events branch from ce432f4 to 2eb04d0 Compare July 23, 2020 15:38
@jelbourn jelbourn merged commit 77b11f4 into angular:master Jul 29, 2020
P2 PRs automation moved this from In Progress to Done Jul 29, 2020
jelbourn pushed a commit that referenced this pull request Jul 29, 2020
Fixes `mat-select` emitting its change event twice when a reset value is selected, as well as when it's selected twice in a row. This PR covers #10859 which would've introduced another issue.

Fixes #10675.
Fixes #13579.

(cherry picked from commit 77b11f4)
@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 Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
P2 PRs
  
Done
Development

Successfully merging this pull request may close these issues.

Mat Select emits twice on reset Selecting reset option in mat-select
10 participants