RESOLVED FIXED 189010
[Datalist] Pressing enter without a selected option shouldn't change the input
https://bugs.webkit.org/show_bug.cgi?id=189010
Summary [Datalist] Pressing enter without a selected option shouldn't change the input
Aditya Keerthi
Reported 2018-08-27 14:58:24 PDT
Currently, the value of an input field gets cleared if there is no selected datalist suggestion when the enter key is pressed. The correct behavior is to leave the value of the input as-is.
Attachments
Patch (6.18 KB, patch)
2018-08-27 15:33 PDT, Aditya Keerthi
no flags
Aditya Keerthi
Comment 1 2018-08-27 15:33:03 PDT
WebKit Commit Bot
Comment 2 2018-08-28 10:03:03 PDT
Comment on attachment 348216 [details] Patch Clearing flags on attachment: 348216 Committed r235427: <https://trac.webkit.org/changeset/235427>
WebKit Commit Bot
Comment 3 2018-08-28 10:03:05 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 4 2018-08-28 10:04:19 PDT
Darin Adler
Comment 5 2018-08-28 19:55:42 PDT
Seems unnecessary to use std::optional<String> since WTF::String already has a null value (distinct from the empty string). Typically we can use null string to mean no string, and we don’t have to involve std::optional. Unless we also need to use null string for some other valid value.
Aditya Keerthi
Comment 6 2018-08-28 22:35:35 PDT
(In reply to Darin Adler from comment #5) > Seems unnecessary to use std::optional<String> since WTF::String already has > a null value (distinct from the empty string). Typically we can use null > string to mean no string, and we don’t have to involve std::optional. Unless > we also need to use null string for some other valid value. I will address this in a follow-up patch. I can't think of a case where we'd want to use the null string for a valid value.
Note You need to log in before you can comment on or make changes to this bug.