# Allow selecting text from comments

Currently when you long-press a comment the "comment options" dialog appears, just like when you tap it.

I am requesting to keep the "comment options" for a tap, but on long-press to show the text selection dialog (the one that appears when you long-press on a question or answer)

This would allow users to select text from comments, e.g. in order to paste terms in Google etc.

Update: Kasra Rahjerdi suggested in the comments that the copy functionality could be added in the pop-up menu instead. Do people consider this useful?

• This was originally posted on MSO, but I was asked to post here instead. – user000001 Jul 19 '14 at 10:48
• Hmm.. looks like Android has a bug bug where if you make some text selectable, it takes two taps to actually "click" it for the regular click action. Would adding "Copy" to the pop-up menu (not using Android's built in copy/paste) work? – Kasra Rahjerdi Jul 21 '14 at 17:42
• @KasraRahjerdi Thanks for looking into this. If it is added to the menu would it select the whole comment, or would you be able to select only part of the text? In any case it would be better than what we have now IMO. – user000001 Jul 21 '14 at 17:45
• It'd be the entire comment, that's why I'm kind of wary about doing it since it won't match the UI of copy/pasting from the question or answer right above it. – Kasra Rahjerdi Jul 21 '14 at 17:46
• @KasraRahjerdi It would still be better than nothing. You could still paste it somewhere and then delete the extra text. But that is just my opinion. We could see what others have to say about it. – user000001 Jul 21 '14 at 17:49
• I'm tending to agree with you, but yeah let's see if anyone else chimes in. – Kasra Rahjerdi Jul 21 '14 at 17:50
• @KasraRahjerdi Currently, for comments containing MathJax you offer a WebView in which text can be selected. (I checked). Just do the same for all comments. Maybe change the name of the link from Render MathJax to Display Separately, or something. – user259867 Jul 21 '14 at 23:11
• @Thisismuchhealthier. that seems, really, hacky... the MathJax thing there is already a hack, I'd rather not add onto it. Besides changing the copy on that would both confuse people who want to see it with Mathjax rendered, and people who would want to copy it (you'd have to know that it's possible under that option). – Kasra Rahjerdi Jul 22 '14 at 1:24
• @KasraRahjerdi Okay. Then I'd rather see a "Select Text" option in the comment menu (instead of "Copy") which would -- somehow -- present the text of comment in selectable form, possibly with the entire comment already selected. Then the user would be able to adjust the range of selection. – user259867 Jul 22 '14 at 1:29
• @Thisismuchhealthier. That's a great idea. I'm going to look into how Android handles copy/pasting tomorrow to see if I can manually bring up the system UI myself. – Kasra Rahjerdi Jul 22 '14 at 1:31
• I looked into it and it doesn't seem to be do-able to do it that way. If this gets implemented it's most likely just going to be a single "Copy Text" option in the pop-up. – Kasra Rahjerdi Jul 22 '14 at 21:43

Good news everyone!

As of version 1.0.44 (coming out later tonight or tomorrow) we have a whole new way of comment UI which includes a "Copy text" option, it currently copies the markdown plain-text version of the comment, since copying the rendered HTML seemed weird. If this ends up being a bad idea, I'll switch them around.

Here's what it looks like after you tap on a comment:

Definitely

One of the reason is because it's quite troublesome when you want to copy a code snippet in the comment, having to type it manually and also prone to error.

Possible implementations:

1. "Copy Text" option in the pop-up. (Excerpt from the discussion in comment) This option will copy the entire comment. User then can paste it somewhere and then delete the extra text. From my point of view, this is the simplest and is already good enough, and I'd prefer to go this direction.
2. "Select Text" option in the comment menu. (Excerpt from the discussion in comment) Present the text of comment in selectable form, possibly with the entire comment already selected. Then the user would be able to adjust the range of selection by manually bringing up the system UI. However, it doesn't seem to be do-able to do it that way. The workaround is to show a dialog with EditText (or the more limited TextView) containing the comment itself with buttons "Copy" and "Cancel". User then can modify the content before copying to the clipboard. However, I think this needs too much work for a simple function, and "Implementation 1" can achieve same result with less resource.
3. "Share" with "Copy to clipboard" option. Instead only copying, why not also enable sharing the comment? However, for "Copy to clipboard" function" this won't work in all devices as explained in the answer. This is just an idea, since I don't think many people want to share comment.