You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
When setting an `input` element's `value` attribute via `el.setAttribute()`,
the displayed value is not updated, and the original value returned by
`el.value` instead of the new value. To fix this, assign the `value` attribute
both ways.
Also, add tests to catch this problem.
Closesyoutube#359.
When setting an `input` element's `value` attribute via `el.setAttribute()`,
the displayed value is not updated, and the original value is returned by
`el.value` instead of the new value. To fix this, assign the `value` attribute
both ways.
Also, add tests to catch this problem.
Closesyoutube#359.
nicksay
added a commit
to nicksay/spfjs
that referenced
this issue
Jan 6, 2016
When setting an `input` element's `value` attribute via `el.setAttribute()`,
the displayed value is not updated, and the original value is returned by
`el.value` instead of the new value. To fix this, assign the `value` attribute
both ways.
Also, add tests to catch this problem.
Closesyoutube#359.
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.
The text was updated successfully, but these errors were encountered: