Created
January 19, 2009 00:30
-
-
Save lsinger/48818 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)resignFirstResponder | |
{ | |
#if PLATFORM(DOM) | |
var element = [[self class] _inputElement]; | |
//nil out dom handlers | |
element.onkeyup = nil; | |
element.onkeydown = nil; | |
element.onkeypress = nil; | |
_DOMElement.removeChild(element); | |
[self setStringValue:element.value]; // redundant? | |
// If textfield has no value, then display the placeholderValue | |
if (!_value) | |
[self setStringValue:[self placeholderString]]; | |
#endif | |
//post CPControlTextDidEndEditingNotification | |
[self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidBeginEditingNotification object:self userInfo:nil]]; | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment