Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

MdcSelector doesn't show the right text when bool value false is set #2035

@leondroidgeeks

Description

@leondroidgeeks

Describe the bug
The select item of a form consisting of two items whose values are true and false won't show the right option for the false value if the select item is set using FormGroup.setValue(false).

To Reproduce
Steps to reproduce the behavior:
Build a small form with a selector called formControlName="current". Selector has two options where the values are [value]="true" and [value]="false". Initialize the form in TypeScript using the formbuilder so the form can be accessed via the variable "filterForm". If the item current in the FormGroup.group() function is initialized with false, the selector won't show the appropriate text for the false value. If it is initialized with true and now in ngOnInit filterForm.controls.current.setValue(false) is called the same behavior is shown. There is not problem with true as a value, here the right text is shown.

We also have a template on StackBlitz which we encourage you to use to create a reproduction of the issue. The less time it takes for us to reproduce the issue, the less time it takes to verify and fix it!

Expected behavior
Selector should show the right text for options with bool false values and not only for options with bool true values.

What Angular MDC version are you using?
2.0.0

What OS are you using?:
macOS

What browser(s) is this bug affecting?:
Chrome and Safari

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions