googlearchive / paper-slider

A slider à la Material Design
16 stars 18 forks source link

paper-slider -- immediateValue property duplicates value property #29

Open kenmoore opened 9 years ago

kenmoore commented 9 years ago

I suspect there's something I'm missing, but the value property of a paper-slider reflects the current slider value, and can be set to apply a new value. What is the need for the immediateValue property? If there's a case for it, please make note of it in the documentation.

David-Mulder commented 9 years ago

Try dragging and log the two attributes ;-)

kenmoore commented 9 years ago

Thanks for the hint, here are some observations:

I'd say:

David-Mulder commented 9 years ago

Well, once I found the docs I thought it was pretty clear, but believe me, it confused me a lot as well. And regarding on-input, check #30

kenmoore commented 9 years ago

I'm still unclear on whether there's a good reason not to architect the element such that the 'value' property always shows the value that the slider's position matches (whether idle, during drag, or upon click), and you could do away with the mostly (but peculiarly not always) redundant property immediateValue?

David-Mulder commented 9 years ago

I don't know this officially, but I suppose the 'problem' this solves is that polymer applications aren't that event driven, normally you observe for changes to properties, not for actual events. And now you have a choice how that binding should behave. Not necessarily defending this choice, just rationalizing it.

grigio commented 9 years ago

:+1 Shouldn't <paper-slider> fire an event from immediateValueChanged ? I'm trying to get the value while the user is dragging the marker but it doesn't seem to be working as advertised https://github.com/Polymer/paper-slider/blob/master/paper-slider.html#L178-L185

David-Mulder commented 9 years ago

@grigio Did you polymer bind it to the value of immediateValue?

grigio commented 9 years ago

I tried but it seems to work like changed event

David-Mulder commented 9 years ago

@grigio Try taking a look at this code, I got it working there, but it's been a couple of weeks since then~