CPTokenField does not support Focus or Blur Notifications #1396

Closed
walisser opened this Issue Nov 14, 2011 · 9 comments

Projects

None yet

6 participants

@walisser
Contributor

Is there a reason for this? Since CPTokenField is a subclass of CPTextField it should implement these notifications?

The fix would appear to be simple. As a workaround I have a subclass of CPTokenField that overrides these:

- (BOOL)becomeFirstResponder
{
    var become = [super becomeFirstResponder];

    if (become)
        [self textDidFocus:[CPNotification 
            notificationWithName:CPTextFieldDidFocusNotification
            object:self userInfo:nil]];

    return become;
}

- (BOOL)resignFirstResponder
{
    // NOTE: this appears to be a BUG in cappuccino

    var resign = [super resignFirstResponder];

    if (resign)
        [self textDidBlur:[CPNotification 
            notificationWithName:CPTextFieldDidBlurNotification
            object:self userInfo:nil]];

    return resign;
}
@cappbot
cappbot commented May 9, 2012

Label: #new. What's next? A reviewer should examine this issue.

@schipmolder

#needs-reduction
+AppKit
+bug

@cappbot
cappbot commented May 21, 2012

Labels: #needs-reduction, #new, AppKit, bug. What's next? A minimal test app should be created which demonstrates the concern of this issue in isolation.

@ahankinson
Contributor

-#new
+#needs-review
milestone=Someday

@cappbot
cappbot commented Feb 16, 2013

Milestone: Someday. Labels: #needs-reduction, #needs-review, AppKit, bug. What's next?

  • A minimal test app should be created which demonstrates the concern of this issue in isolation.
  • This issue is pending an architectural or implementation design decision and should be discussed or voted on.
@aparajita
Contributor

Is there a reason for this?

Sheer laziness/incompetence on the part of the author. 😆

@aparajita
Contributor

You have the code, why not make a pull request?

@aljungberg aljungberg pushed a commit that closed this issue Jun 12, 2013
@ahankinson ahankinson Fixed: CPTokenField sends focus and blur notifications
This commit adds notifications for focus and blur on CPTokenField.

Attached is a modified Manual CPTokenFieldTest that observes these notifications.

Fixes #1396
6ef5b46
@aljungberg
Member

milestone=0.9.7
+#fixed

@cappbot
cappbot commented Jun 12, 2013

Milestone: 0.9.7. Labels: #fixed, AppKit, bug. What's next? This issue is considered successfully resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment