Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resetting a live-bound <textarea> changes its value to __!!__ #223

Merged
merged 1 commit into from
Jan 10, 2013

Conversation

daffl
Copy link
Contributor

@daffl daffl commented Jan 9, 2013

Demo:
http://jsfiddle.net/5vD9u/2/

Threads:
https://forum.javascriptmvc.com/topic/1-1-1-resetting-a-form-changes-input-values-to#32525000001098027
https://forum.javascriptmvc.com/topic/1-1-3-resetting-a-live-bound-textarea-changes-its-value-to

In the first thread above, Curtis Cummings wrote:
"When the <textarea> is created it is given a placeholder value of !! and then is quickly updated with the proper value. Because !! was technically the original value, reseting that textarea displays !!."

@justinbmeyer
Copy link
Contributor

Is there a way to update a textarea's reset value?

@daffl
Copy link
Contributor

daffl commented Jan 9, 2013

Looks like there is by setting the defaultValue of the DOM element: Fiddle

@ccummings
Copy link
Contributor

We do this here: https://github.com/bitovi/canjs/blob/master/view/render.js#L51 for . Looks like we just need to add <textarea> to this.

@ghost ghost assigned daffl Jan 10, 2013
daffl added a commit that referenced this pull request Jan 10, 2013
Fix: Resetting a live-bound <textarea> changes its value to __!!__
@daffl daffl merged commit fbefceb into master Jan 10, 2013
@daffl daffl deleted the live-bound-textarea-223 branch January 10, 2013 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants