Cocoa always sends NSControlTextDidEndEditingNotification and the action when resigning, whether or not editing had begun.

This commit is contained in:
Aparajita Fishman
2011-09-02 02:48:34 -04:00
parent b91042eb08
commit 271a1ef3b4
+4 -8
View File
@@ -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]];