Closed masaoliou closed 9 years ago
Stumbled on this bug as well.
This happens when you bind a javascript variable of type number
, which makes total sense since you are using <input type="number">
.
If you use string
, the bug doesn't happen.
It's probably related to the bind variable becoming string
when the binding happens.
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/iron-input/iron-input.html">
<dom-module id="my-example">
<template>
<input id="example" type="number" is="iron-input" bind-value="{{example}}" on-change="onInputChange">
</template>
<script>
Polymer({
is: "my-example",
ready: function () {
this.example = 1;
console.log(typeof this.example); // number !!!
},
onInputChange: function () {
console.log(typeof this.example); // string !!!
}
});
</script>
</dom-module>
This has already been fixed
I need to show 0 when the value is zero. Is this a feature or am I missing any
<iron-input>
attribute?