BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
855 stars 130 forks source link

Computed max attribute on <input type=range> quirks #348

Closed laurensdijkstra closed 8 years ago

laurensdijkstra commented 8 years ago

When using a data-linked computed observable as the max attribute of an input of type range the input stops updating the value attribute observably.

The first time one starts manipulating the computed observable max value, the range doesn't respond at all. Only after using the input at least once makes it respond to the computed max attribute. However, the value attribute is still not observably changed.

See https://jsfiddle.net/1tpjj1gb/ for a (contrived) example.

Paul-Martin commented 8 years ago

If I understand the behavior you want, I believe you simply need to specify two way data-link using this syntax: data-link="{:val:} max{:~max()}" https://jsfiddle.net/1tpjj1gb/2/

(updated because in my pre coffee answer I added the two way link syntax to max instead of val)

laurensdijkstra commented 8 years ago

Hah! Yes indeed that is what I was looking for :) Thank you!