Questions tagged [textselection]

In User Interface Design, text selection is the method of handpicking a portion of text, most commonly for the purpose of copying/cutting/pasting.

In User Interface Design, text selection is the method of handpicking a portion of text that will be further acted upon by the user. The selection is done by the interaction devices provided by the user interface.

Text selection is most commonly associated with the user actions of copying, cutting, and pasting. In Graphical User Interface, text selection is performed by a mouse or touch represented as cursors.

459 questions
6041
votes
45 answers

How to disable text selection highlighting

For anchors that act like buttons (for example, the buttons on the sidebar of this Stack Overflow page titled Questions, Tags, and Users) or tabs, is there a CSS standard way to disable the highlighting effect if the user accidentally selects the…
anon
444
votes
6 answers

Get the Highlighted/Selected text

Is it possible to get the highlighted text in a paragraph of a website e.g. by using jQuery?
Dan
  • 4,481
  • 3
  • 15
  • 3
308
votes
5 answers

How do I disable text selection with CSS or JavaScript?

I am making a HTML/CSS/jQuery gallery, with several pages. I indeed have a "next" button, which is a simple link with a jQuery click listener. The problem is that if the user click the button several times, the text of the button is selected, and…
daviddarx
  • 3,485
  • 3
  • 20
  • 23
237
votes
4 answers

How to make HTML Text unselectable

I would like to add text to my webpage as a label and make it unselectable. In other words, When the mouse cursor is over the text I would like it to not turn into a text selecting cursor at all. A good example of what I'm trying to achieve is the…
Ben
  • 10,020
  • 21
  • 94
  • 157
150
votes
10 answers

IntelliJ Column Selection using Cursor Keys

Is it possible to some how setup IntelliJ IDEA so that I can column select with the cursor keys similarly to how I might in Notepad++, Visual Studio, or FlashDevelop. For instance when I'm typing code I almost always do my navigation solely through…
148
votes
16 answers

Is there a way to make text unselectable on an HTML page?

I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers. I might be able to solve this with a…
Tyler
  • 28,498
  • 11
  • 90
  • 106
88
votes
2 answers

How do you select text in vim?

In most text editors, I can select text by clicking and dragging with my mouse, and then using Ctrl-C to copy that text, or Backspace to delete it. However, since vim runs in the console, if I highlight some text with the mouse, my vim commands…
Cory Klein
  • 51,188
  • 43
  • 183
  • 243
46
votes
9 answers

How to override default text selection of android webview os 4.1+?

Before posting this question I've searched a lot but could not find any clear answers on this issue. I have to override default text selection of android webview & show my custom text selection dialog options. I have tried this sample code…
sachin003
  • 8,983
  • 4
  • 21
  • 23
42
votes
3 answers

How to select every N line in vscode?

How can I select every N lines in visual studio code. I can't find a proper regualr expression can let me do this.
42
votes
6 answers

How to get selected text from a textbox control with JavaScript

I have a textbox and a link button. When I write some text, select some of it and then click the link button, the selected text from textbox must be show with a message box. How can I do it? When I click the submit button for the textbox below, the…
mavera
  • 3,171
  • 7
  • 45
  • 58
42
votes
4 answers

Why is .disableSelection() deprecated?

.disableSelection in JQueryUI 1.9 is deprecated. The only explanation I can find is, literally, "Disabling text selection is bad. Don't use this." and "We shouldn't allow developers to mess with text selection. This was originally for the…
Jason Kleban
  • 20,024
  • 18
  • 75
  • 125
40
votes
2 answers

IOS: Text Selection in WKWebView (WKSelectionGranularityCharacter)

I've got an app that uses a web view where text can be selected. It's long been an annoyance that you can't select text across a block boundary in UIWebView. WKWebView seems to fix this with a property on its configuration: selectionGranularity. …
Tom Hamming
  • 10,577
  • 11
  • 71
  • 145
39
votes
3 answers

Coordinates of selected text in browser page

I need the coordinates in pixels of the beginning of the text selection (anywhere on the page, not in a textarea). I tried using the cursor coordinates but this didn't work quite well because the cursor coordinates and the beginning of the selection…
Bouke
  • 660
  • 2
  • 7
  • 22
34
votes
5 answers

How to disable cursor positioning and text selection in an EditText? (Android)

I'm searching for a way to prevent the user from moving the cursor position anywhere. The cursor should always stay at the end of the current EditText value. In addition to that the user should not be able to select anything in the EditText. Do you…
Louis
  • 2,140
  • 4
  • 19
  • 18
33
votes
9 answers

Disabling text selection in PhoneGap

Is it possible to disable text selection to make a PhoneGap app more similar to normal native app? Something like this: document.onselectstart = function() {return false;} or: * { user-select: none; -moz-user-select: -moz-none; -khtml-user-select:…
stmn
  • 439
  • 1
  • 5
  • 8
1
2 3
30 31