10

OK, this is really annoying. When you are entering a question in SO, and you attempt to highlight something in the preview to copy/paste, your selection is immediately removed. With Fiddler open I can see a post being made to /posts/validate-body, and the focus seems to be set back to the question entry textarea.

Why can't we highlight or select text in the preview output area? This smells like a UI bug.

1
  • 1
    Can reproduce this in FF on Windows. Very annoying.
    – nobody
    Jan 5, 2015 at 22:53

1 Answer 1

0

events screen-shot

It is not a bug, it is designed to focus back on textarea.

There is a click event attached to preview box, in addition to other listeners, e.g. touchend.

function(e) {
  2 != e.which && $(this).siblings().find("textarea").focus()
}
12
  • 2
    I wasn't asking for a technical dissection - I am quite capable of doing that myself. Does the behavior not seem unintuitive to you? I understand hijacking the first click, but no matter how many times I click I can't select anything on the page.
    – mellamokb
    Jan 5, 2015 at 23:20
  • @mellamokb well, sometimes it annoys me, but I'm used it. If I want to copy something, I just do it from within edit box.
    – Omar
    Jan 5, 2015 at 23:21
  • 1
    @mellamokb sometimes annoying != not intuitive. If I can select text from edit box, why would I do so from preview box?
    – Omar
    Jan 5, 2015 at 23:26
  • 1
    Here's the example that motivated the question. After typing out a fairly lengthy question, I found myself wanting to copy a piece of code into SSMS to quickly validate it. The preview shows everything expanded, rather than hunting through a 14-row tall textarea (not to mention the wonky scrollwheel behavior in Chrome that sometimes scrolls by an entire page of content). But regardless of the specific circumstances, preventing selection on any webpage in general is a degradation of user experience IMHO.
    – mellamokb
    Jan 5, 2015 at 23:30
  • @mellamokb In that case, tag your question with "feature-request". If accepted, it will be useful for all users.
    – Omar
    Jan 5, 2015 at 23:37
  • 2
    I'm curious who thought this was a good idea to implement in the first place. What's it supposed to be accomplishing?
    – nobody
    Jan 5, 2015 at 23:39
  • @AndrewMedico It could be helpful in case of lengthy posts, where you want to copy something from preview box as it shows the entire post unlike edit box.
    – Omar
    Jan 5, 2015 at 23:44
  • 3
    @Omar No, I'm asking who thought it was a good idea to implement the focus-switch-on-click. I agree that reverting it to normal browser behavior would be a good idea.
    – nobody
    Jan 5, 2015 at 23:46
  • @AndrewMedico ask Joel :)
    – Omar
    Jan 5, 2015 at 23:56
  • 2
    Also, If you want to copy text without also copying the source markdown, this would be great. Apr 6, 2015 at 7:26
  • 1
    @Omar Unrelated question. Which plugin/tool is letting you view the event handlers ?
    – Rob Mod
    Sep 3, 2015 at 6:36
  • @Rob - Its built into Firefox. If you right click on something in a document and click "Inspect Element" you get that window.
    – theB
    Oct 3, 2015 at 14:02

Not the answer you're looking for? Browse other questions tagged .