diff --git a/AppKit/CPDatePicker/_CPDatePickerTextField.j b/AppKit/CPDatePicker/_CPDatePickerTextField.j index 37780ef43..85ea5a45f 100644 --- a/AppKit/CPDatePicker/_CPDatePickerTextField.j +++ b/AppKit/CPDatePicker/_CPDatePickerTextField.j @@ -533,9 +533,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; } @@ -1282,6 +1286,12 @@ var CPMonthDateType = 0, return self; } +/*! @ignore */ +- (BOOL)acceptsFirstResponder +{ + return [_datePicker isEnabled]; +} + /*! Set the dateType of the textField */ - (void)setDateType:(int)aDateType @@ -1734,4 +1744,9 @@ var CPMonthDateType = 0, return frameSize; } -@end +- (CGRect)bezelRectForBounds:(CGRect)bounds +{ + return CGRectMakeCopy(bounds); +} + +@end \ No newline at end of file