Skip to content

Commit

Permalink
Do not change input/textarea text selection for the same value
Browse files Browse the repository at this point in the history
Fixes #2412.
  • Loading branch information
domenic committed Apr 17, 2017
1 parent 3fc8301 commit 8cbd605
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions source
Expand Up @@ -48644,6 +48644,9 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<p>On setting:</p>

<ol>
<li><p>Let <var>oldValue</var> be the element's <span
data-x="concept-fe-value">value</span>.</p></li>

<li><p>Set the element's <span data-x="concept-fe-value">value</span> to the new
value.</p></li>

Expand All @@ -48653,9 +48656,10 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<li><p>Invoke the <span>value sanitization algorithm</span>, if the element's <code
data-x="attr-input-type">type</code> attribute's current state defines one.</p></li>

<li><p>If the element has a text entry cursor position, move the text entry cursor position to
the end of the text control, unselecting any selected text and <span data-x="set the selection
direction">resetting the selection direction</span> to "<code data-x="">none</code>".</p></li>
<li><p>If the new value is different from <var>oldValue</var> and the element has a text entry
cursor position, move the text entry cursor position to the end of the text control,
unselecting any selected text and <span data-x="set the selection direction">resetting the
selection direction</span> to "<code data-x="">none</code>".</p></li>
</ol>
</dd>

Expand Down Expand Up @@ -50625,15 +50629,19 @@ interface <dfn>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
perform the following steps:</p>

<ol>
<li><p>Let <var>oldAPIValue</var> be this element's <span
data-x="concept-fe-api-value">API value</span>.</p></li>

<li><p>Set this element's <span data-x="concept-textarea-raw-value">raw value</span> to the new
value.</p></li>

<li><p>Set this element's <span data-x="concept-fe-dirty">dirty value flag</span> to
true.</p></li>

<li><p>Move the text entry cursor position to the end of the text control, unselecting any
selected text and <span data-x="set the selection direction">resetting the selection
direction</span> to "<code data-x="">none</code>".</p></li>
<li><p>If the new <span data-x="concept-fe-api-value">API value</span> is different from
<var>oldAPIValue</var>, then move the text entry cursor position to the end of the text control,
unselecting any selected text and <span data-x="set the selection direction">resetting the
selection direction</span> to "<code data-x="">none</code>".</p></li>
</ol>

<p>The <dfn><code data-x="dom-textarea-textLength">textLength</code></dfn> IDL attribute must
Expand Down

0 comments on commit 8cbd605

Please sign in to comment.