Bug 305598

Summary: <datalist> suggestions ignore <option> label when matching input
Product: WebKit Reporter: nicolas.delafuente01
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: akeerthi, cdumez, lily_spiniolas, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 26   
Hardware: iPhone / iPad   
OS: iOS 26   
See Also: https://bugs.webkit.org/show_bug.cgi?id=305091
Attachments:
Description Flags
test case none

nicolas.delafuente01
Reported 2026-01-15 13:53:13 PST
Created attachment 478038 [details] test case When entering text in an <input> with an associated <datalist>, the predictive text bar and the suggestions dropdown do not consider the <option> label/textContent when matching the input (only the value) According to the HTML specification section 4.10.5.3.9: “If appropriate, the user agent should use the suggestion’s label and value to identify the suggestion to the user.” WebKit already uses both label and value on macOS Safari, but iOS Safari ignores the label when determining which options to suggest. This creates a cross-platform inconsistency and reduces clarity for users. Example: <input list="numbers" placeholder="Number" autocomplete="off"> <datalist id="numbers"> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> <option value="4">Four</option> </datalist> Observed behavior: - Only the value (e.g., 1, 2, 3) is used to determine the suggestions in the dropdown and predictive text bar. - Only the value is not shown in the predictive text bar Expected behavior: - Autofill searches both value and label - If possible, both value and label are shown in the predictive text bar
Attachments
test case (450 bytes, text/html)
2026-01-15 13:53 PST, nicolas.delafuente01
no flags
Alexey Proskuryakov
Comment 1 2026-01-16 13:06:26 PST
Thank you for the report! I'm not sure if "ignores the label when determining which options to suggest" precisely matches what I observed when trying this out, but what happened seemed difficult to explain, so there is likely a bug here.
nicolas.delafuente01
Comment 2 2026-01-19 14:11:04 PST
For the attached test case, if you type 'o', it causes the dropdown to not open (no options), and the predictive text bar shows | 1 | 2 | 3 | but I would expect the dropdown to show 1 (One), 2 (Two), 4 (Four), and the predictive text bar would update to | 1 | 2 | 4 |
Radar WebKit Bug Importer
Comment 3 2026-01-22 13:54:12 PST
Note You need to log in before you can comment on or make changes to this bug.