Bug 221532 - [macOS] Return key binding for date inputs conflicts with return to submit form
Summary: [macOS] Return key binding for date inputs conflicts with return to submit form
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aditya Keerthi
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-07 13:11 PST by Aditya Keerthi
Modified: 2021-02-08 08:42 PST (History)
8 users (show)

See Also:


Attachments
Patch (19.59 KB, patch)
2021-02-07 13:13 PST, Aditya Keerthi
wenson_hsieh: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (19.56 KB, patch)
2021-02-07 13:58 PST, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch for landing (22.66 KB, patch)
2021-02-07 14:03 PST, Aditya Keerthi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aditya Keerthi 2021-02-07 13:11:09 PST
Steps To Reproduce:
1. Go to https://www.w3schools.com/TAGS/tryit.asp?filename=tryhtml5_input_type_date
2. Press shift-TAB to focus the birthday field
3. Type a date
4. Press return

Observe that the calendar view is presented, and the form is not submitted.
Comment 1 Aditya Keerthi 2021-02-07 13:11:24 PST
<rdar://problem/74039204>
Comment 2 Aditya Keerthi 2021-02-07 13:13:37 PST
Created attachment 419544 [details]
Patch
Comment 3 Wenson Hsieh 2021-02-07 13:30:17 PST
Comment on attachment 419544 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=419544&action=review

> Source/WebCore/html/BaseDateAndTimeInputType.cpp:421
> +    int charCode = event.charCode();

Nit - I'm not sure the local variable adds much here. Maybe just check (event.charCode() == '\r') below?
Comment 4 Aditya Keerthi 2021-02-07 13:58:18 PST
Created attachment 419546 [details]
Patch
Comment 5 Aditya Keerthi 2021-02-07 14:03:12 PST
Created attachment 419547 [details]
Patch for landing
Comment 6 Aditya Keerthi 2021-02-07 14:03:55 PST
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 419544 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=419544&action=review
> 
> > Source/WebCore/html/BaseDateAndTimeInputType.cpp:421
> > +    int charCode = event.charCode();
> 
> Nit - I'm not sure the local variable adds much here. Maybe just check
> (event.charCode() == '\r') below?

Removed the local variable.

Thanks for the review!
Comment 7 EWS 2021-02-08 07:13:49 PST
commit-queue failed to commit attachment 419547 [details] to WebKit repository. To retry, please set cq+ flag again.
Comment 8 EWS 2021-02-08 07:37:08 PST
commit-queue failed to commit attachment 419547 [details] to WebKit repository. To retry, please set cq+ flag again.
Comment 9 EWS 2021-02-08 08:42:17 PST
Committed r272495: <https://commits.webkit.org/r272495>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 419547 [details].