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 Mar 15, 2017
1 parent 639459a commit 7c751c9
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -48065,6 +48065,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 @@ -48074,9 +48077,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 @@ -50052,15 +50056,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-textarea-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 7c751c9

Please sign in to comment.