Skip to content

Instantly share code, notes, and snippets.

@prmichaelsen
Created February 17, 2020 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prmichaelsen/bf1f853bb54c95070cedc543ef85d849 to your computer and use it in GitHub Desktop.
Save prmichaelsen/bf1f853bb54c95070cedc543ef85d849 to your computer and use it in GitHub Desktop.

Opinion

Stop making text in your applications unselectable.

Copying and pasting is one of the most common things a user will do to any text you display in your application. Here are some things that applications do that make this difficult or impossible:

  • override mobile select function to select entire "blocks" of text for copying, for instance, news articles.
  • trigger some action on click, such as expanding a table row or launching an edit modal on click. Another example is launching a directions app on address click.
  • misusing the input html element to display summary text by adding "disabled" and therefore stopping a user from selecting the text

For each, I propose the following alternatives:

  • block text select: the only solution for this is to not do this. Push back on business requirements that call for this.
  • trigger on text click: use buttons for application interactions. In the case of addresses launching an app, this may also be a business requirement. I encourage you to push back.
  • disabled form fields: create a summary view of your entities instead of recycling the creation/edit forms.

The more power you put into the users hand, the more they will feel good about using your app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment