sproutcore/sproutcore — pull request #683 by workmanw (2012-01-07 01:15:02+00:00)
Title: Fixes pasting into text fields on latest webkit

I cherry picked another change from merge_public for SC.TextFieldView to fix an issue with pasting into an SC.TextFieldView. Here is a quote from original commit: "Because invokeLater was being used instead of setTimeout, on the latest webkit, pasting into a text field did not pick up the pasted text in its value."

As with my last cherry pick from merge_public, I cherry picked the changes from merge_public to 1) provide proper attribution for those who helped resolve the issue and 2) to help make merge_public easier to diff and merge at some point.

----

This pull request came about via issue #682 . To clarify the issue is that if you click in a text field, paste code, then a submit button the pasted text is not properly committed and the binding value is out of date.

I can't figure out how to create a unit test to prove this problem, so an example code snippet will have to do. To reproduce this issue run the following code, paste any amount of text into the text field on the panel pane and then immediately click 'Submit'. Do not allow the text field to loose focus or you will not reproduce this issue.

```
SC.PanelPane.create({
layout: { width: 400, height: 72, centerY: 0, centerX: 0 },
contentView: SC.View.extend({
childViews: 'label textField submitButton'.w(),
textFieldValue: "",

label: SC.LabelView.design({
layout: { left: 10, right: 10, top: 10, height: 18 },
value: "Please paste any text value into the text field, then click 'Submit'."
}),

textField: SC.TextFieldView.design({
layout: { left: 10, right: 100, top: 38, height: 24 },
valueBinding: ".parentView.textFieldValue"
}),

submitButton: SC.ButtonView.design({
layout: { right: 10, width: 80, top: 38, height: 24 },
title: "Submit",
action: 'submitClicked'
}),

submitClicked: function() {
var displayStr = "Binding value from SC.TextField: '" + this.get('textFieldValue') + "'";
SC.AlertPane.info({ description: displayStr });
}
})
}).append();
```