Skip to content

Commit

Permalink
Clarify the difference between disabled and readonly
Browse files Browse the repository at this point in the history
This removes the inaccurate mention that being disabled prevents
selection, which was not supported by any normative requirements and has
caused confusion for several implementers so far. Fixes #1852.
  • Loading branch information
domenic committed Oct 12, 2016
1 parent a6ea8e5 commit 5918513
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions source
Expand Up @@ -46950,11 +46950,22 @@ ldh-str = &lt; as defined in <a href="https://tools.ietf.org/html/rfc1034#

</div>

<p class="note">The difference between <code data-x="attr-fe-disabled">disabled</code> and <code
data-x="attr-input-readonly">readonly</code> is that read-only controls are still focusable, so the
user can still select the text and interact with it, whereas disabled controls are entirely
non-interactive. (For this reason, only text controls can be made read-only: it wouldn't make
sense for checkboxes or buttons, for instances.)</p>
<div class="note">
<p>The difference between <code data-x="attr-fe-disabled">disabled</code> and <code
data-x="attr-input-readonly">readonly</code> is that read-only controls can still function,
whereas disabled controls generally do not function as controls until they are enabled. This is
spelled out in more detail elsewhere in this specification with normative requirements that refer
to the <span data-x="concept-fe-disabled">disabled</span> concept (for example, the element's
<span>activation behavior</span>, whether or not it is a <span>focusable area</span>, or when
<span>constructing the form data set</span>). Any other behavior related to user interaction with
disabled controls, such as whether text can be selected or copied, is not defined in this
specification.</p>

<p>Only text controls can be made read-only, since for other controls (such as checkboxes and
buttons) there is no useful distinction between being read-only and being disabled, so the
<code data-x="attr-input-readonly">readonly</code> attribute <span data-x="do not apply">does not
apply</span>.</p>
</div>

<div class="example">

Expand Down

0 comments on commit 5918513

Please sign in to comment.