sproutcore/sproutcore — pull request #681 by workmanw (2012-01-06 20:04:48+00:00)
Title: SC.TextFieldView instantiates and adds accessory view as child multiple times.

Added unit test to prove accessory views are getting instantiated more than once, then fixed the problem.

To elaborate further, _getAccessoryViewWidths() was referring to the accessory view classes instead the instantiated views.

It was calling: ``` accessoryView = this.get(position + 'AccessoryView'); ```
Instead of: ``` accessoryView = this['_' + position + 'AccessoryView']; ```

Additionally, in the event _getAccessoryViewWidths() found a class it would improperly create a view from it (not adding the view to the internal cache). Since I have updated this function to **always** find the instantiated view, there is no need for it to create views. This code was removed.

The result in all of this was the same view being created and added as a child multiple times. Not only is this incorrect, but it causes major issues with views using preset layerIds.