Summary: | Date and Time form controls not showing correct initial values on immediate second invocation. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Megan Gardner <megan_gardner> | ||||||
Component: | New Bugs | Assignee: | Megan Gardner <megan_gardner> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | thorton, webkit-bug-importer, wenson_hsieh | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Megan Gardner
2020-04-16 11:09:34 PDT
Created attachment 396817 [details]
Patch
Comment on attachment 396817 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=396817&action=review > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:4325 > +- (void)updateValueAsNumberForViewController:(double)value Nit - the “ForViewController:" suffix makes it sound like the argument should be a `UIViewController *`, but instead it’s a value. What about naming these -updateFocusedElementValueAsNumber: and -updateFocusedElementValue: instead? > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:8488 > +#elif PLATFORM(IOS) This excludes Mac Catalyst — is that intentional? > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:153 > + NSDateComponents *components = [calendar components:(NSCalendarUnitHour) fromDate:[_datePicker date]]; Nit - don’t need () around NSCalendarUnitMinute. > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:161 > + NSDateComponents *components = [calendar components:(NSCalendarUnitMinute) fromDate:[_datePicker date]]; Nit - ditto regarding the (). > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:280 > + date = [[self dateFormatterForPicker] dateFromString:timeString]; Nit - I don’t think the date local variable adds much value here, but if you prefer to include it, I’d move this down so that it’s just: NSDate *date = [[self dateFormatterForPicker] dateFromString:timeString]; > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:328 > + if ([self.control isKindOfClass:WKDateTimePopover.class]) Nit - WKDateTimePopover and WKDateTimePicker are not subclasses of each other, so you don’t need the return statements here. Created attachment 397014 [details]
Patch for landing
Committed r260402: <https://trac.webkit.org/changeset/260402> All reviewed patches have been landed. Closing bug and clearing flags on attachment 397014 [details]. |