emberjs/ember.js — Issue #407: Stop Ember.TextField clearing its value as it's torn down
Author: gunn
Created: 2012-01-17 03:07:09+00:00
State: open

Currently an Ember.TextField as it's removed, clears its value.
You can see this causing trouble at http://jsfiddle.net/LDyJg/2/
@wagenet came up with a fix you can see at http://jsfiddle.net/LDyJg/4/

which sets the Ember.TextSupport mixin _elementValueDidChange method to:

```javascript
_elementValueDidChange: function(){
var val = this.$().val();

if (val !== undefined) {
this.set('value', val);
} else {
// the element is receiving blur because it was
// removed, so don't do anything.
}
}
```

Because a textfield / textarea should never have a value of `undefined` unless it's being removed.