ractivejs / ractive

Next-generation DOM manipulation
http://ractive.js.org
MIT License
5.94k stars 397 forks source link

ractive edge version chokes on <input type="file"> #750

Closed maxgalbu closed 10 years ago

maxgalbu commented 10 years ago

See the fiddle: http://jsfiddle.net/ZsRTH/

Whenever in the template appears an <input type="file">, Ractive gives an error:

this.attribute is undefined

This does not happen with regular inputs, like text or password. The error can be resolved by adding a variabile for two way binding on the input value, but it shouldn't be needed :)

skeptic35 commented 10 years ago

:+1: stumbled upon that one as well

jonvuri commented 10 years ago

It looks like this is because there is no isBindable() check on the value attribute before the binding is assigned: https://github.com/ractivejs/ractive/blob/dev/src/virtualdom/items/Element/prototype/init/createTwowayBinding.js#L40

The value attribute is the one that interacts with the two-way data binding for the file type, so that should probably be checked. I'll write up a PR.

Rich-Harris commented 10 years ago

Closing - thanks @jrajav