From ed4235d2f98bb1f777df2bc4d7b2f3c0b7033cc2 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sat, 2 Oct 2010 14:28:46 -0400 Subject: [PATCH] Fixed: setting any binding on a text field - even on an attribute like 'hidden' - would clear its placeholder string. --- AppKit/CPTextField.j | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 5b54996d5..7879d6ffb 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -792,10 +792,14 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); - (void)_setCurrentValueIsPlaceholder:(BOOL)isPlaceholder { + // The initial _currentValueIsPlaceholder is null so convert it to NO for comparison purposes. + if (!!_currentValueIsPlaceholder === isPlaceholder) + return; + if (isPlaceholder) { // Save the original placeholder value so we can restore it later - // Only do this if the placeholder is not already overridden because the bindings logic might call this method + // Only do this if the placeholder is not already overridden because the bindings logic might call this method // several times and we don't want the bindings placeholder to ever become the original placeholder if (!_currentValueIsPlaceholder) _originalPlaceholderString = [self placeholderString];