Closed Bug 1291179 Opened 8 years ago Closed 5 years ago

The html datalist search not working like chrome?

Categories

(Core :: DOM: Core & HTML, defect, P5)

47 Branch
All
Windows 7
defect

Tracking

()

RESOLVED WORKSFORME
Webcompat Priority -

People

(Reporter: ranjan653, Unassigned)

References

()

Details

(Keywords: parity-chrome, parity-edge, parity-ie)

Attachments

(1 file)

Attached image datalist_issue.png
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Steps to reproduce:

Please go through the link for example.
http://www.w3schools.com/tags/tryit.asp ... 5_datalist

If you type "i" in the text box for chrome shows one record i.e Internet Explorer
But firefox displays Internet Explorer, Firefox and Safari.




Actual results:

If you type "i" in the text box for chrome shows one record i.e Internet Explorer
But firefox displays Internet Explorer, Firefox and Safari.


Expected results:

If you type I the expexted result should be "Internet Explorer" like Chrome browser
Please solve this issue as high priority
Severity: normal → critical
OS: Unspecified → Windows 7
Priority: -- → P5
Hardware: Unspecified → All
(This is not any of crashes, loss of data, severe memory leak, so changing back to normal severity.
 https://bugzilla.mozilla.org/page.cgi?id=fields.html#bug_severity )

Apparently, Chrome, Edge and IE11 use prefix match, and Firefox uses substring match.
(WebKit doesn't support it)

I don't see anything in the spec that defines the matching algorithm for list attribute tho, it might be nice to use same algorithm as other browsers.
https://html.spec.whatwg.org/multipage/forms.html#the-datalist-element
https://html.spec.whatwg.org/multipage/forms.html#attr-input-list
Severity: critical → normal
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Whiteboard: [parity-chrome][parity-edge][parity-ie]
Severity: normal → major
What can be done so that i can get the exact result like chrome?
So the data list is used as an input for autocomplete and that code does substring match.
I'd say the behavior Gecko has is quite reasonable - works way better with certain types of list, like
country names, or lists containing first and second name etc.
I wonder if the datalist could have some attribute giving UA some hint how the data should be used.
Perhaps worth to file a spec bug: https://github.com/whatwg/html/issues/new
The spec has been updated to suggest substring match: https://html.spec.whatwg.org/multipage/forms.html#attr-input-list

However, the substring match should be searched in both the value and the label, whereas Firefox only searches (and displays) the label. See bug #869690.

Also of note, since this bug was filed, Chrome was updated to use substring matching. (But, per spec, on both the value and label.)
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Whiteboard: [parity-chrome][parity-edge][parity-ie]
Webcompat Priority: --- → ?

Given Comment #5, let's close here. The remaining issue described by Domenic is covered in Bug 869690 (I think).

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Webcompat Priority: ? → -
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: