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
  • Loading branch information
domenic authored and inikulin committed May 9, 2017
1 parent 04b4649 commit 40f7a4a
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 @@ -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 40f7a4a

Please sign in to comment.