mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-14 06:31:27 +00:00
Merge pull request #2204 from Dogild/CPDatePicker-CPTableView
Fixed: CPDatePicker in a CPTableView wrong behavior
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user