mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-01 10:52:03 +00:00
Fixed: timing of CPControlTextDidBeginEditingNotification (#1941)
This commit is contained in:
1 parent
da35d6b6ed
commit
d0d7033f63
2 files changed
+8
-2
No files matched your search
@@ -1131,6 +1131,12 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
if (![self isEnabled] || !([self isEditable] || [self isSelectable]))
|
||||
return;
|
||||
|
||||
if ([self isEditable] && !_isEditing)
|
||||
{
|
||||
_isEditing = YES;
|
||||
[self textDidBeginEditing:[CPNotification notificationWithName:CPControlTextDidBeginEditingNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
// CPTextField uses an HTML input element to take the input so we need to
|
||||
// propagate the dom event so the element is updated. This has to be done
|
||||
// before interpretKeyEvents: though so individual commands have a chance
|
||||
|
||||
@@ -453,8 +453,8 @@ CPTokenFieldDeleteButtonType = 1;
|
||||
{
|
||||
[_tokenScrollView documentView]._DOMElement.appendChild(element);
|
||||
|
||||
//post CPControlTextDidBeginEditingNotification
|
||||
[self textDidBeginEditing:[CPNotification notificationWithName:CPControlTextDidBeginEditingNotification object:self userInfo:nil]];
|
||||
// Removed so CPTokenField doesn't fire the notification the moment it becomes the first responder, but instead defers to the first keystroke, just like Cocoa (see keyDown: in CPTextField).
|
||||
// [self textDidBeginEditing:[CPNotification notificationWithName:CPControlTextDidBeginEditingNotification object:self userInfo:nil]];
|
||||
|
||||
[[CPRunLoop mainRunLoop] performBlock:function()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user