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(button-toggle): static checked value not being picked up #18442

Merged

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Feb 9, 2020

Fixes the static checked value of a button toggle not having an effect in Ivy, because it ends up being assigned earlier than we expect. This is a side effect of the circular dependency between the toggle group and the toggle which should be cleaned up at some point, because it's not the first time it has caused issues with things going out of sync.

Fixes #18427.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Feb 9, 2020
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 9, 2020
@@ -294,7 +294,7 @@ export class MatButtonToggleGroup implements ControlValueAccessor, OnInit, After
// the side-effect is that we may end up updating the model value out of sequence in others
// The `deferEvents` flag allows us to decide whether to do it on a case-by-case basis.
if (deferEvents) {
Promise.resolve(() => this._updateModelValue(isUserInput));
Promise.resolve().then(() => this._updateModelValue(isUserInput));
Copy link
Member Author

Choose a reason for hiding this comment

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

This change has nothing to do with the fix, but I noticed that it wasn't actually doing anything so I fixed it.

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

Fixes the static checked value of a button toggle not having an effect in Ivy, because it ends up being assigned earlier than we expect. This is a side effect of the circular dependency between the toggle group and the toggle which should be cleaned up at some point, because it's not the first time it has caused issues with things going out of sync.

Fixes angular#18427.
@crisbeto crisbeto force-pushed the 18427/button-toggle-static-checked branch from 96a9414 to dd80da5 Compare March 1, 2020 16:44
@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Mar 1, 2020
@jelbourn jelbourn merged commit 7f7e0a1 into angular:master Apr 23, 2020
jelbourn pushed a commit that referenced this pull request Apr 23, 2020
Fixes the static checked value of a button toggle not having an effect in Ivy, because it ends up being assigned earlier than we expect. This is a side effect of the circular dependency between the toggle group and the toggle which should be cleaned up at some point, because it's not the first time it has caused issues with things going out of sync.

Fixes #18427.
soro-google pushed a commit to soro-google/components that referenced this pull request Apr 24, 2020
…#18442)

Fixes the static checked value of a button toggle not having an effect in Ivy, because it ends up being assigned earlier than we expect. This is a side effect of the circular dependency between the toggle group and the toggle which should be cleaned up at some point, because it's not the first time it has caused issues with things going out of sync.

Fixes angular#18427.
@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 May 24, 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 P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mat-button-toggle default checked not wotking
3 participants