Skip to content

Commit

Permalink
Fix for setStringValue on CPTextField being broken if first responder.
Browse files Browse the repository at this point in the history
First commit by Nick Takayama! Thanks!

[cappuccino#100 state:resolved]
  • Loading branch information
Ross Boucher committed Oct 10, 2008
1 parent 816d0d3 commit c2b1130
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions AppKit/CPTextField.j
Expand Up @@ -460,10 +460,17 @@ var _CPTextFieldSquareBezelColor = nil;
else if (aValue)
displayString += aValue;

if (CPFeatureIsCompatible(CPJavascriptInnerTextFeature))
_DOMTextElement.innerText = displayString;
else if (CPFeatureIsCompatible(CPJavascriptTextContentFeature))
_DOMTextElement.textContent = displayString;
if ([[self window] firstResponder] == self)
{
[[self class] _inputElement].value = displayString;
}
else
{
if (CPFeatureIsCompatible(CPJavascriptInnerTextFeature))
_DOMTextElement.innerText = displayString;
else if (CPFeatureIsCompatible(CPJavascriptTextContentFeature))
_DOMTextElement.textContent = displayString;
}
#endif
}

Expand Down

0 comments on commit c2b1130

Please sign in to comment.