youtube / spfjs

A lightweight JS framework for fast navigation and page updates from YouTube
https://youtube.github.io/spfjs/
MIT License
2.24k stars 147 forks source link

Input element with prior value not updating with setAttribute #359

Closed rviscomi closed 8 years ago

rviscomi commented 9 years ago

See this jsfiddle: https://jsfiddle.net/cbbpfven/

When an input element already has a value set (in this case, by el.value) updating that value via el.setAttribute doesn't change the displayed value. el.getAttribute returns the updated value, but el.value still shows the old value.

spf.dom.setAttributes is directly affected by this bug: https://github.com/youtube/spfjs/blob/master/src/client/dom/dom.js#L149

This could just be a Chrome bug, but we can work around it by reassigning el.value with the updated value.