paper-slider
paper-slider copied to clipboard
Slider not change value when the binding data is set to `undefined`
With paper-sliver in version "1.0.3"
The slider not change the display value (in editable or not), when the binding value is set to undefined
.
The problem is the slider keep the last value. That is a big problem when you load some data from a web-service, and when is they are no value define.
I write a little web-component that reset the json value when you click in the button.
<dom-module id="slider-bug">
<template>
<h1>Not reset on change value to undefined</h1>
<section>
<paper-button on-tap="unsetSliderValue">
<iron-icon icon="user"></iron-icon>
<span>Reset Slider value = [<span>{{data.slider}}</span>]</span>
</paper-button>
</section>
<paper-slider min="10" max="200" value="{{data.slider}}" editable="true"></paper-slider>
</template>
</dom-module>
<script>
Polymer({
is: 'slider-bug',
properties: {
data: {
type: Object,
notity: true,
value: function () {
return {slider: 15}
}
}
},
unsetSliderValue: function () {
this.set('data.slider', undefined);
}
});
</script>
Init State
After click the button
@jmorille I think we can handle this case.
+1