News for hackers. Stuff that matters.
Re:Picozu - the HTML5 Adobe Photoshop clone by jarek-foksa on Tuesday February 28, 2012 @03:31PM (#3644837)
When building desktop-like apps I'm using following snippet to disable text selection everywhere:

  body * {
    -webkit-user-select: none;
    -moz-user-select:    none;
    -ms-user-select:     none;
    user-select:         none;
  }
Then I whitelist any elements that should be selectable:

  textarea,
  input,
  [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select:    text;
    -ms-user-select:     text;
    user-select:         text;
  }

There are no comments on this comment yet.