mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-04 09:53:41 +00:00
fixed: tokenfield CPControlTextDidBeginEditingNotification notification
This commit is contained in:
@@ -349,6 +349,12 @@ CPTokenFieldDeleteButtonType = 1;
|
||||
if (theBinding)
|
||||
[theBinding reverseSetValueFor:@"objectValue"];
|
||||
|
||||
if (!_isEditing)
|
||||
{
|
||||
_isEditing = YES;
|
||||
[self textDidBeginEditing:[CPNotification notificationWithName:CPControlTextDidBeginEditingNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
[self textDidChange:[CPNotification notificationWithName:CPControlTextDidChangeNotification object:self userInfo:nil]];
|
||||
|
||||
_shouldNotifyTarget = YES;
|
||||
@@ -498,6 +504,8 @@ CPTokenFieldDeleteButtonType = 1;
|
||||
|
||||
[self _resignFirstKeyResponder];
|
||||
|
||||
_isEditing = NO;
|
||||
|
||||
if (_shouldNotifyTarget)
|
||||
{
|
||||
_shouldNotifyTarget = NO;
|
||||
@@ -1032,6 +1040,16 @@ CPTokenFieldDeleteButtonType = 1;
|
||||
CPTokenFieldTextDidChangeValue = [self stringValue];
|
||||
#endif
|
||||
|
||||
// Has to be enabled, and it also has to be editable or selectable.
|
||||
if (![self isEnabled] || !([self isEditable] || [self isSelectable]))
|
||||
return;
|
||||
|
||||
if ([self isEditable] && !_isEditing)
|
||||
{
|
||||
_isEditing = YES;
|
||||
[self textDidBeginEditing:[CPNotification notificationWithName:CPControlTextDidBeginEditingNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
// Leave the default _propagateCurrentDOMEvent setting in place. This might be YES or NO depending
|
||||
// on if something that could be a browser shortcut was pressed or not, such as Cmd-R to reload.
|
||||
// If it was NO we want to leave it at NO however and only enable it in insertText:. This is what
|
||||
|
||||
Reference in New Issue
Block a user