Skip to content

[MdCheckbox] Checkbox boolean model with default value of null #1701

Closed
@sambhav-gore

Description

@sambhav-gore

I want the ability to specify the true-value and false-value as boolean when the initial (default) value for the model for checkbox is null

Steps to reproduce

<md-checkbox v-model="field">Approved?</md-checkbox>
{{field}}

Which browser?

Chrome

What is expected?

When the default value is 'null' after checking the checkbox it becomes 'on'
I want the ability to specify that when the checkbox is checked, the value in model should be 'true' and when further unchecked it should be false.
In other words I want the v-bind:true-value and v-bind:false-value to work correctly with md-checkbox

What is actually happening?

md-checkbox is dynamically setting the value in model by checking the type of binding.

Reproduction Link

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions