in Platform Updates

User-Friendly Text Selection

Bartosz Olchówka in UX, on March 18, 2014

Have you ever encountered a poor text selection solution? For instance, most web applications offer API keys that can be used by developers and when the key is offered in plain text format, it can be problematic to quickly copy & paste it into the console.

Let’s have a look at the example:

Text selection before the fix

In Google Chrome, double-clicking the API key selects the “key” word that stands nearby.

What’s interesting, it works that way only when the API key starts with a letter. If it starts with a digit, the “key” word is not selected.

Here’s the HTML code of the example:

<dt>Your API key:</dt>

You can easily fix the problem by wrapping the API key with a span element and styling it using display:block.

<dt>Your API key:</dt>
<dd>**<span class="select-fix">**f109851029801928501**</span>**</dd>

.select-fix {
	display: block;

As a result, it is possible to easily copy & paste the API key in the console:

Another good way of dealing with the problem is to use a form element. If it does not mess with your design, you can put the API key inside an <input> element which handles copy & paste properly. MailChimp displays its API keys using this method:

API key selection in Mailchimp


Copy & paste seems to be an easy task. However, when you dive in the details, it stops being as simple as it sounds.

Always consider what actions a user must perform to reach the goal.

See what other UI mistakes developers often make in this article.

See other Platform Updates

Speeding Up LiveChat API

Keeping the SSL connection up Reducing request times mode http - we had to use this option to be able to use http-specific rules forwardfor….

Read more

Installable Web Applications

The majority of today’s apps is web applications (i.e.

Read more
See all updates