From 2d79ac0aafffe726d9a166441e22d815e4a810f4 Mon Sep 17 00:00:00 2001 From: Nick Takayama Date: Fri, 10 Oct 2008 10:26:36 +0800 Subject: [PATCH] patching an issue where a CPTextField that was in firstResponder state would not properly update when setStringValue: was called on it Signed-off-by: Nick Takayama --- AppKit/CPTextField.j | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index a61b7dd..1cfd378 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -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 } -- 1.5.4.5