Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix matching user input to datalist values #4814 #7003

Merged
merged 4 commits into from
Sep 8, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -49505,11 +49505,12 @@ You cannot submit this form when the field is incorrect.</samp></pre>

<p>The <dfn data-x="concept-input-list">suggestions source element</dfn> is the first element in
the <span>tree</span> in <span>tree order</span> to have an <span data-x="concept-id">ID</span>
equal to the value of the <code data-x="attr-input-list">list</code> attribute, if that element is
a <code>datalist</code> element. If there is no <code data-x="attr-input-list">list</code>
equal to the value of the <code data-x="attr-input-list">list</code> attribute, if that element
is a <code>datalist</code> element. If there is no <code data-x="attr-input-list">list</code>
attribute, or if there is no element with that <span data-x="concept-id">ID</span>, or if the
first element with that <span data-x="concept-id">ID</span> is not a <code>datalist</code>
element, then there is no <span data-x="concept-input-list">suggestions source element</span>.</p>
element, then there is no <span data-x="concept-input-list">suggestions source
element</span>.</p>

<p>If there is a <span data-x="concept-input-list">suggestions source element</span>, then, when
the user agent is allowing the user to edit the <code>input</code> element's <span
Expand All @@ -49523,9 +49524,12 @@ You cannot submit this form when the field is incorrect.</samp></pre>
data-x="concept-input-list">suggestions source element</span> when the number of suggestions is
large, including only the most relevant ones (e.g. based on the user's input so far). No precise
threshold is defined, but capping the list at four to seven values is reasonable. If filtering
based on the user's input, user agents should use substring matching against both the suggestions'
<span data-x="concept-option-label">label</span> and <span
data-x="concept-option-value">value</span>.</p>
based on the user's input, user agents should search within both the <span
data-x="concept-option-label">label</span> and <span data-x="concept-option-value">value</span>
of the suggestions for matches. User agents might need to consider how input variations affect
the matching process, as users might expect language-specific case folding, different underlying
Unicode code point sequences, or keyboard- or input-specific variations (such as different forms
of Japanese kana) to be part of the matching process. For examples, see <ref spec=CHARMODNORM>.</p>
aphillips marked this conversation as resolved.
Show resolved Hide resolved

<div class="example">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: move the <ref spec=CHARMODNORM> to the end of the paragraph after the final .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<p>This text field allows you to choose a type of JavaScript function.</p>
Expand Down Expand Up @@ -125282,6 +125286,10 @@ INSERT INTERFACES HERE
<dt id="refsCHARMOD">[CHARMOD]</dt>
<dd>(Non-normative) <cite><a href="https://www.w3.org/TR/charmod/">Character Model for the World Wide Web 1.0: Fundamentals</a></cite>, M. D&uuml;rst, F. Yergeau, R. Ishida, M. Wolf, T. Texin. W3C.</dd>

<dt id="refsCHARMODNORM">[CHARMODNORM]</dt> <dd>(Non-normative) <cite><a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapping is confused here. (The great rewrapper does not work well with dt/dds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

href="https://www.w3.org/TR/charmod-norm/">Character Model for the World Wide Web: String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use https://w3c.github.io/charmod-norm/ instead (we always cite EDs in WHATWG specs, never TR).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix.

(I don't think there is an ED for charmod just above, which may be an exception to the rule... which I faithfully copied).

Matching</a></cite>, A.Phillips. W3C.</dd>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after "A."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


<dt id="refsCOMPOSITE">[COMPOSITE]</dt>
<dd><cite><a href="https://drafts.fxtf.org/compositing/">Compositing and Blending</a></cite>, R. Cabanier, N. Andronikos. W3C.</dd>

Expand Down