diff --git a/AppKit/CPDatePicker/_CPDatePickerTextField.j b/AppKit/CPDatePicker/_CPDatePickerTextField.j index 77f541212..e871b1a5a 100644 --- a/AppKit/CPDatePicker/_CPDatePickerTextField.j +++ b/AppKit/CPDatePicker/_CPDatePickerTextField.j @@ -553,9 +553,13 @@ var CPZeroKeyCode = 48, #pragma mark - #pragma mark Responder methods +/*! @ignore */ - (BOOL)acceptsFirstResponder { - return NO; + // This is needed to accept to be firstResponder when nothing is selected. + // This element needs to be first responder when the CPDatePicker is in the CPTableView + // When clicking on a row of a CPTableView where there isn't a date element, the CPTableView will ask this element to know if it can becomes or not a firstResponder. + return [_datePicker isEnabled] && ![self superview]._currentTextField; } @@ -1328,6 +1332,12 @@ var CPMonthDateType = 0, return self; } +/*! @ignore */ +- (BOOL)acceptsFirstResponder +{ + return [_datePicker isEnabled]; +} + /*! Set the dateType of the textField */ - (void)setDateType:(int)aDateType @@ -1782,4 +1792,9 @@ var CPMonthDateType = 0, return frameSize; } -@end +- (CGRect)bezelRectForBounds:(CGRect)bounds +{ + return CGRectMakeCopy(bounds); +} + +@end \ No newline at end of file