honglio / niukj

An Online Authoring Platform - write & present & share your slide
http://www.niukj.com
Other
0 stars 0 forks source link

Make things that shouldn't be selectable unselectable #65

Closed honglio closed 9 years ago

honglio commented 9 years ago

It's really annoying when a user trying to interact with an element causes the element, or the text within it, to be selected instead. Adding user-select: none to everything, except for the things that a user would genuinely want to copy paste can cut way down on these interactions being accidentally triggered.

Adding -webkit-touch-callout: none; to an element prevents a tap and hold from opening a context menu on the link or image.

user-select: none;
-{prefix}-user-select: none;
-webkit-touch-callout: none;

On Android, to stop these menu's from showing up, you can do:

if(navigator.userAgent.match(/Android/i))
  noContextMenu.addEventListener('contextmenu', function (e) { e.preventDefault() })

27

honglio commented 9 years ago

Add user-select: none; to button, link, image, text.

honglio commented 9 years ago

.btn already set to unselected in bootstrap v3.3.4