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

Projects
None yet
3 participants
@daffl
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Jan 9, 2013

Contributor

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

Contributor

justinbmeyer commented Jan 9, 2013

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

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jan 9, 2013

Contributor

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

Contributor

daffl commented Jan 9, 2013

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

@ccummings

This comment has been minimized.

Show comment
Hide comment
@ccummings

ccummings Jan 9, 2013

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.

Contributor

ccummings commented Jan 9, 2013

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

Merge pull request #223 from bitovi/live-bound-textarea-223
Fix: Resetting a live-bound <textarea> changes its value to __!!__

@daffl daffl merged commit fbefceb into master Jan 10, 2013

1 check passed

default The Travis build passed
Details

@daffl daffl deleted the live-bound-textarea-223 branch Jan 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment