From 271a1ef3b49a57e7f83deedcabf13c157fede2fd Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Fri, 2 Sep 2011 02:46:22 -0400 Subject: [PATCH] Cocoa always sends NSControlTextDidEndEditingNotification and the action when resigning, whether or not editing had begun. --- AppKit/CPTextField.j | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index b89272043..5fb8e2b05 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -626,15 +626,11 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); #endif - // post CPControlTextDidEndEditingNotification - if (_isEditing) - { - _isEditing = NO; - [self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidEndEditingNotification object:self userInfo:nil]]; + _isEditing = NO; + [self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidEndEditingNotification object:self userInfo:nil]]; - if ([self sendsActionOnEndEditing]) - [self sendAction:[self action] to:[self target]]; - } + if ([self sendsActionOnEndEditing]) + [self sendAction:[self action] to:[self target]]; [self textDidBlur:[CPNotification notificationWithName:CPTextFieldDidBlurNotification object:self userInfo:nil]];