Open
Bug 1291193
Opened 8 years ago
Updated 2 years ago
The input type="url" with datalist example in WHATWG spec does not use the value for matching
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
NEW
People
(Reporter: alice0775, Unassigned)
References
(Blocks 1 open bug, )
Details
(Keywords: parity-chrome, Whiteboard: DUPEME)
Attachments
(1 file)
577 bytes,
text/html
|
Details |
The exsample in WHATWG spec does not work as expected
<input type="url" name="location" list="urls" style="width:300px">
<datalist id="urls">
<option label="MIME: Format of Internet Message Bodies" value="https://tools.ietf.org/html/rfc2045">
<option label="HTML" value="https://html.spec.whatwg.org/">
<option label="DOM" value="https://dom.spec.whatwg.org/">
<option label="Fullscreen" value="https://fullscreen.spec.whatwg.org/">
<option label="Media Session" value="https://mediasession.spec.whatwg.org/">
<option label="The Single UNIX Specification, Version 3" value="http://www.unix.org/version3/">
</datalist>
Steps to reproduce:
1. Open attached
2. Type spec.w
Actual Results:
Nothing is displayed
Expected Results:
Four URLs(match the input text) should be displayed
Chrome Dev54 works as expected.
Reporter | ||
Updated•8 years ago
|
Summary: The exsample in WHATWG spec does not work as expected → The input type="url" with datalist exsample in WHATWG spec does not work as expected
Comment 1•8 years ago
|
||
Hi Jessica, do you know if we have implemented this feature yet or not?
Flags: needinfo?(jjong)
Comment 2•8 years ago
|
||
We do support list attribute in type=url, however, we use 'label' to match user's input and not 'value'. IMHO, the spec is a little bit ambiguous about this, in the example in [1], it is using 'value' to match user's input, but in [2], it says: "The user agent may use the suggestion's label to identify the suggestion if appropriate."
I tested Chrome (52.0.2743.82) on Ubuntu, it uses 'value' to do the matching, but it has to be an exact match, typing 'spec.w' shows nothing. Am I doing anything wrong?
[1] https://html.spec.whatwg.org/multipage/forms.html#url-state-(type=url)
[2] https://html.spec.whatwg.org/multipage/forms.html#attr-input-list
Flags: needinfo?(jjong)
Sounds like Chrome is doing wrong here by using value and not label.
And we do substring matching and Chrome uses prefix matching I think.
Mounir, do you happen to know why Chrome does what it does? Does it just always ignore label?
Flags: needinfo?(mounir)
Comment 5•8 years ago
|
||
Blink's code says that it is using label and value because Firefox uses label and Edge uses value:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLInputElement.cpp?rcl=0&l=1601
The change was written in July 2016 so it might be in Chrome Dev. It should be in Chrome 54.
Flags: needinfo?(mounir)
Summary: The input type="url" with datalist exsample in WHATWG spec does not work as expected → The input type="url" with datalist example in WHATWG spec does not work as expected
Comment 6•8 years ago
|
||
So, is there anything we need to do here? Or should we file a spec bug to make things clearer?
Updated•8 years ago
|
Priority: -- → P2
Comment 7•8 years ago
|
||
(In reply to Jessica Jong [:jessica] from comment #6)
> So, is there anything we need to do here? Or should we file a spec bug to
> make things clearer?
That's best, yes. Be sure to CC Anne. Thanks!
Flags: needinfo?(jjong)
Updated•8 years ago
|
Priority: P2 → P3
Comment 8•8 years ago
|
||
(In reply to Andrew Overholt [:overholt] from comment #7)
> (In reply to Jessica Jong [:jessica] from comment #6)
> > So, is there anything we need to do here? Or should we file a spec bug to
> > make things clearer?
>
> That's best, yes. Be sure to CC Anne. Thanks!
Filed https://github.com/whatwg/html/issues/1811. Keeping the NI for tracking.
Comment 9•8 years ago
|
||
A quick update, the spec [1] will be suggesting to use label and value to match the user's input.
[1] https://github.com/whatwg/html/pull/1836
Updated•7 years ago
|
Flags: needinfo?(jessi3py)
Updated•7 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: The input type="url" with datalist example in WHATWG spec does not work as expected → The input type="url" with datalist example in WHATWG spec does not use the value for matching
Comment 10•7 years ago
|
||
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Keywords: parity-chrome
Whiteboard: DUPEME,[parity-Chrome] → DUPEME,
Updated•7 years ago
|
Whiteboard: DUPEME, → DUPEME
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•4 years ago
|
Blocks: input-list
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•