Skip to content

v-model on custom component behaves differently in IE and Edge #4796

@andrewcourtice

Description

@andrewcourtice

Vue Version

2.1.10

Issue Description

Based on other examples I've seen, when embedding a checkbox in a custom component a 'proxy' value has to be used to emulate the native v-model behaviour for a checkbox or radio input.

This is particularly important when binding v-model on the custom component to an array as opposed to a boolean.

This technique works fine in Firefox and Webkit-based browsers but fails in IE and Edge.

Demonstration of Issue

http://jsfiddle.net/andrewcourtice/jgxzbbvv/

Steps to Reproduce

  1. Open the above fiddle in a Firefox or a Webkit-based browser
  2. Check the checkboxes and note the array of selected items being updated correctly
  3. Open the above fiddle in IE or Edge
  4. Check the checkboxes and note the difference in behaviour to step 2

Expected Outcome

The array of selected items (and the raw output) should be updated as each item is checked.

Actual Outcome

In IE and Edge the raw output is displaying a boolean value and the checked state of the checkboxes is inconsistent.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions