paper-slider icon indicating copy to clipboard operation
paper-slider copied to clipboard

Slider not change value when the binding data is set to `undefined`

Open jmorille opened this issue 9 years ago • 3 comments

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>

jmorille avatar Jul 30 '15 15:07 jmorille

Init State bug-slider-init

After click the button bug-slider-reset

jmorille avatar Jul 30 '15 15:07 jmorille

@jmorille I think we can handle this case.

blasten avatar Aug 04 '15 04:08 blasten

+1

azurewaters avatar Oct 30 '15 03:10 azurewaters