Skip to content

Commit 0169208

Browse files
committed
[css-ui] Add note about excessive use of user-select:none
Closes w3c#1317
1 parent fcd1c99 commit 0169208

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

css-ui-4/Overview.bs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,25 @@ Omitted values are set to their initial values.
10331033
that would hamper usability
10341034
or violate common user expectations.
10351035

1036+
<div class=note>
1037+
Authors should be careful about not constraining the user unnecessarily.
1038+
For example, setting ''user-select: none'' on the root element,
1039+
and relaxing that restriction on a handful of elements the author judges useful to select can be frustrating to users:
1040+
1041+
* Clicking in empty areas to undo the current selection will no longer be effective
1042+
* The author may have overlooked some areas which should be selectable
1043+
* Areas may be added later to the page without remembering to make them selectable
1044+
* The user may want to select pieces of text other than the main content,
1045+
for instance to look them up in a dictionary or in some translation tool,
1046+
or to look for warnings and error messages in a search engine…
1047+
1048+
Instead, a good practice is for authors is to selectively apply ''user-select: none'' to elements
1049+
which seem likely to be accidentaly selected
1050+
when doing so would interfere with the more likely intended acction.
1051+
Accidentally leaving parts of the page that are unlikely to be intereacted with selectable
1052+
will likely cause much less frustration to users than the oposite.
1053+
</div>
1054+
10361055
<dt><dfn>contain</dfn>
10371056
<dd>UAs must not allow a selection which is started in this element
10381057
to be extended outside of this element.

0 commit comments

Comments
 (0)