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
1
vote
1 answer

How to inhibit selection of TK Text widget?

I am trying to find the best way to inhibit text selection in a Tk text widget. Here an example of code using Iwidget's ScrolledText: package require Iwidgets iwidgets::scrolledtext .t pack .t I already tried to bind to <> virtual event…
Adriano
  • 487
  • 4
  • 8
1
vote
3 answers

JavaScript: Need to find which of multiple substring occurrences has been selected(highlighted) in a given string

Given any block of text, using the following as an example: Baseball is a sport. A pitcher throws the baseball and the batter hits the baseball. I need to determine, using JavaScript (use of jQuery is fine), which of the three instances of…
David Link
  • 536
  • 3
  • 9
1
vote
1 answer

Can I find the tag with selected text in a chrome extension?

If I have added a item in the context menu : chrome.contextMenus.create({ "title" : chrome.i18n.getMessage("right_click") , "type" : "normal", "contexts" : ["selection"], "onclick" : my_function() // returns a callback function }); How can I get…
1
vote
2 answers

When a user selects a chunk of text on a webpage, is there a way to keep this text highlighted even when the user clicks somewhere else on that page?

Let's say a user selects (with his/her mouse) the first line of a paragraph. Later, he/she selects another line farther down the page. Is there a way to keep the previously selected text (in addition to the newly selected text) highlighted? How…
lamuchacho
  • 15
  • 1
  • 5
1
vote
0 answers

Careful selection text in OnTouchEvent

I wrote a code for select a part of text but But I can't find the exact point of beginning and ending. My code: @Override public boolean onTouchEvent(MotionEvent event) { final int action = event.getAction(); switch (action)…
azad
  • 361
  • 2
  • 5
  • 17
1
vote
2 answers

How can you prevent clearing the selection before onclick event processing?

I want to attach an event handler to a node that processes the current selection, but before the click event fires, it appears as though the selection is cleared by the browser (Chrome 16.0.912.63). I can work around this in a slightly messy…
slacy
  • 11,397
  • 8
  • 56
  • 61
1
vote
1 answer

How to override the dojo control focus method on FF

We have an existing application using dijit controls. The previous behavior on pre FF6 when the control is focused is it also gets selected. However, starting FF6 the control is no longer selecting all text. The problem now is there are a lot of…
Nap
  • 8,096
  • 13
  • 74
  • 117
1
vote
1 answer

Detect text selection about to happen

Is there a way, in iOS, to write code that is called when the system is about to display the text selection controls on a UIWebView? I need some of my code to be called when the user wants to select something, but before the selection is actually…
Cruinh
  • 3,611
  • 4
  • 38
  • 45
1
vote
0 answers

Selection API containsNode seems inconsistent with visible selection

The Selection: containsNode() method takes an optional second argument i.e. partialContainment. When I set this to true, it seems to work ok, but sometimes picks up neighboring elements that are not part of the visible selection. I set it to false…
Mr. Polywhirl
  • 42,981
  • 12
  • 84
  • 132
1
vote
2 answers

only allow select text inside the element, and only if the selection starts inside it

similar question: CSS allow text selection within an element only but that's not what I want I get two sibling elements, if the user starts a text selection inside A, then I don't want any other text outside A to be select-able in the snippet, I…
Littlee
  • 3,791
  • 6
  • 29
  • 61
1
vote
3 answers

How to delete text selection with range in Visual Studio Code?

I have a csv that looks wrong on certain lines so I want to delete lines manually in line range 1 to 281387 using Visual Studio Code as Text Editor. I've tried using the cursor and Ctrl + Shift + ↑ from line 281387 to line 1 but it takes a very…
Jordy
  • 1,802
  • 2
  • 6
  • 25
1
vote
1 answer

Send accelerator with mouse to perform selection of text

I need to make selection of text using mouse instead of ctrl+A I tried: sendAcceleratorKey(MouseEvent.BUTTON1, ""); but I don't know which argument could I set to say make a click with mouse and let the mouse enforced to select the text.
lola
  • 5,649
  • 11
  • 49
  • 61
1
vote
0 answers

how to change double click behavior in vscode editor to increase selected text scope

vscode editor double-clicking on words goes from single word selection to all line instead of gradually expanding the selection scope from word to text including quotations to full line. The bracket select extension does it properly with CTRL+ALT+A…
user15420598
  • 107
  • 7
1
vote
2 answers

Is it possible to distinguish between click and selection?

I have a div with a hidden child. Clicking in the div will toggle the visibility of the child. This works well. Now the user wants to select some text in the child. Dragging the selection works but as soon as the mouse button is released, the div…
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
1
vote
1 answer

Selection object could not be cloned

I've tried 4 ways to clone the Selection object but it does not work. The first 3 methods return a empty Object. document.onselectionchange = function() { let selection = document.getSelection(); if( !selection.isCollapsed ) { var clone1…
Marian07
  • 2,303
  • 4
  • 27
  • 48