Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Should committedValue use "checked" instead of "value"? #65

Open
masaoliou opened this issue Apr 22, 2015 · 0 comments
Open

Should committedValue use "checked" instead of "value"? #65

masaoliou opened this issue Apr 22, 2015 · 0 comments

Comments

@masaoliou
Copy link

Value of committedValue never changes by mouse clicks while value of checked does, as shown by console.log. Maybe committedValue should use property checked instead of value when type is checkbox. No?

    <!DOCTYPE html>
    <html>
    <head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
    <script src="webcomponentsjs/webcomponents.min.js"></script>
    <link rel="import" href="core-input/core-input.html">
    </head>
    <body>
        <template id="i" is="auto-binding" repeat="{{c in inputs}}">
            <input is="core-input" type="checkbox" value="{{c}}" checked?="{{c}}" on-change="{{change}}">
        </template>
        <script>
            var i = document.querySelector('#i');
            i.inputs = [true,false];
            i.change = function(e){
                alert(e.target.value+","+e.target.committedValue+","+e.target.checked);
            }
        </script>
    </body>
    </html>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant