Why can't I highlight text inside a link?



  • Bug: Trying to select text which is a part of link follows that link on mouse-up.
    To reproduce: try to select the word "banana" in this line. Ensure your mouse cursor is over the text when you release the mouse button.

    Bug: Having a post draft in progress makes the progress-bar-thingy disappear if the draft started at the bottom of the page (i.e. the thingy is docked in place instead of floating).



  • Bug: Highlight a thread's title. Copy it. Paste it. A hyperlink appears instead.
    Expectation: That what I highlight actually gets copied.
    Solution: Stop fucking around with browser functions!!! Copy means to fucking copy the shit that's highlighted. Seriously, how the fuck are we supposed to use this forum when it's rife with show-stopping browser breaking bugs? The basics don't work. They used to work. They work elsewhere. They don't work now. Motherfucker.


  • mod

    @Maciejasjmj said:

    Bug: Trying to select text which is a part of link follows that link on mouse-up.To reproduce: try to select the word "banana" in this line. Ensure your mouse cursor is over the text when you release the mouse button.

    In my experience, that tends to be part of how browsers work. I don't think that is something that Discourse is doing.



  • @abarker said:

    In my experience, that tends to be part of how browsers work. I don't think that is something that Discourse is doing.

    It doens't happen outside Discourse. It doesn't even happen outside of posts - the thread links work differently.


  • BINNED

    @abarker said:

    In my experience, that tends to be part of how browsers work. I don't think that is something that Discourse is doing.

    Confirmed here, no repro anywhere else I tried.


  • mod

    @Maciejasjmj said:

    It doens't happen outside Discourse. It doesn't even happen outside of posts - the thread links work differently.

    @Onyx said:

    Confirmed here, no repro anywhere else I tried.

    Ok, maybe I'm misunderstanding. Are you saying just selecting text in the hyperlink? Or that selecting text that starts/ends in the hyperlink? If the first, I can't manage selecting just part of a hyperlink's text anywhere else. If the second, then I can confirm and repro, in which case: WTF? How the hell do you mangle basic browser functionality like that?



  • The steps to reproduce are:

    • Start highlighting text that isn't part of the link
    • Move the highlighting into the text that is part of the link
    • Stop highlighting

    Which is the issue, and is very broken. And technically, @error found it "first", 8 days ago:
    @error said:

    (Damn it's hard to quote a link, it keeps trying to follow it even though highlighting links on most sites doesn't do that.)



  • @abarker said:

    If the first, I can't manage selecting just part of a hyperlink's text anywhere else.

    You can achieve this by starting slightly above the hyperlink. But both cases are screwed up.


  • BINNED

    @abarker said:

    WTF? How the hell do you mangle basic browser functionality like that?

    $('a').on('click', function(eventHandler) {
        eventHandler.preventDefault();
        // custom click handling here
    });
    
    $('a').on('mouseup', function(eventHandler) {
        document.location = $(this).attr('href');
    }
    

    No idea if that's what's happening, but that would do it. First bit is almost certainly true.


  • mod

    @Onyx said:

    ```jquery
    $('a').on('click', function(eventHandler) {
    eventHandler.preventDefault();
    // custom click handling here
    });

    $('a').on('mouseup', function(eventHandler) {
    document.location = $(this).attr('href');
    }

    
    No idea if that's what's happening, but that would do it. First bit is almost certainly true.</blockquote>
    
    Ok, good point. And, thinking about it, they must have done something to get the click count for links. And after reviewing your psuedo-code, they must have tied the new stuff to mouseup instead of click (which is dumb). Hey @codinghorror and @sam, I think @Onyx has a line on what you need to do to fix this one! 
    
    **EDIT:** Oh, a new bug! :anguished:
    
    **Bug:** Quoting a code block DOESN"T WORK!
    **Expected:** Should be obvious.

  • Banned

    Two notes:

    1. Highlighting a link, then mouse release on link, is due to click tracking, which we don't want to do via re-writing all links to a link shortener. It is a limitation, but for the .0001% of the time you find yourself needing to highlight part of a link, can be an issue. Workaround: highlight beyond link, delete extra.

    2. All quoting is plain text at the moment, so all "bugs" related to formatting not appearing in the quote, well.. that's how it is designed right now. If you want formatting, expand the quote via clicking or tapping on the top part of the quote bar.


  • mod

    @codinghorror said:

    2. All quoting is plain text at the moment, so all "bugs" related to formatting not appearing in the quote, well.. that's how it is designed right now. If you want formatting, expand the quote via clicking or tapping on the top part of the quote bar.

    Hmm, you guys fixed the nested quotes thing, so I don't see why you couldn't throw in the formatted quoting at the same time. Very similar cases, just looking for different tags. Or did someone else build a plugin for the nested quotes? In either case, it is a genuine bug that should be fixed.



  • @codinghorror said:

    Highlighting a link, then mouse release on link, is due to click tracking, which we don't want to do via re-writing all links to a link shortener.

    Why do it onmouseup, instead of click? Do browsers simply not allow that to work?
    @codinghorror said:

    but for the .0001% of the time you find yourself needing to highlight part of a link

    Very clearly it's not 0.0001%.

    In fact, you can get a lower bound for that % by taking the users who have mentioned it and divide that by the users with a post count > 0. Then apply my personal rule of thumb that the number of people silently experiencing it is at least 1000% of the mentioners.



  • @codinghorror said:

    All quoting is plain text at the moment, so all "bugs" related to formatting not appearing in the quote, well.. that's how it is designed right now.

    You intend to fix that, though? At some point?



  • @codinghorror said:

    Workaround: highlight beyond link, delete extra.

    Unless you want the handy option to "search on Google". A typical use case: somebody posts a link related to a particular topic - for example, somebody mentioned Microsoft Query in a tag. Now I want to know WTF Microsoft Query is, so I highlight the term, right-click and use "Search Google" - except I can't.

    And please, please, don't use the "nobody does that anyway", or even worse, "it's not how it's supposed to be done" excuse. 99% of cases, it's a sign of bad software.

    PS.
    Minor nitpick: The "Share the link to this post" option appends username to the end of link. Don't know what for, but if I want to share a link, I don't need anyone I share it to to know my handle.


  • Banned

    @Maciejasjmj said:

    And please, please, don't use the "nobody does that anyway", or even worse, "it's not how it's supposed to be done" excuse. 99% of cases, it's a sign of bad software.

    OK, across the dozens of Discourse instances we operate, let me count how many people have complained about this (interference with highlighting text in a body link), since we practice complaint driven development.

    Outside of this site, maybe two people? Ever.

    Not saying it's not an inconvenience but, 1) there is a reason, public click counting without rewriting all URLs which is profoundly evil and 2) the inconvenience barely comes up across the dozens of Discourse instances I personally monitor.


  • mod

    @codinghorror said:

    OK, across the dozens of Discourse instances we operate, let me count how many people have complained about this (interference with highlighting text in a body link), since we practice complaint driven development.

    Outside of this site, maybe two people? Ever.

    Not saying it's not an inconvenience but, 1) there is a reason, public click counting without rewriting all URLs which is profoundly evil and 2) the inconvenience barely comes up across the dozens of Discourse instances I personally monitor.

    I don't know about anyone else, but I don't find click counting all that helpful. It doesn't actually tell me if the people who reply are the ones following the link or not, merely how many. Interesting information? Sure. Useful information? Nope. I'd find it more useful to know if the people who replied actually read everything I posted, including the link.



  • And yet, somehow, three people independently discovered this issue here . Granted, we are a nitpicky community of general assholes, but apparently it's a pretty glaring inconvenience.



  • "General Assholes? Colonel Buttcrack and Admiral Navel are here to see you, sir."

    @Maciejasjmj said:

    apparently it's a pretty glaring inconvenience.

    Perhaps because we are more accustomed than other installations to relying on quoting for context (or intentionally taking things out of context).


  • mod

    @HardwareGeek said:

    (or intentionally taking things out of context).

    I think this might have more to do with our heavy reliance on quoting.


  • :belt_onion:

    @Maciejasjmj said:

    Granted, we are a nitpicky community of general assholes, but apparently it's a pretty glaring inconvenience.

    Having your browser travel to a new page and lose your spot in an infinite-scroll thread is pretty high on the annoying meter. The first time it did it I was confused as to what had happened. Which is one reason why you don't get so many complaints about it... you have to have it happen a couple of times before you figure out that it is intentionally implemented on the mouseup action. If I wasn't a coder, I don't know how long it would take to figure it out to complain about it, I'd probably just assume that the forum is flat broken.



  • Why can't I highlight text inside a link?

    Nope, no repro here.



  • @ben_lubar said:

    Nope, no repro here.

    Which browser?



  • Chrome 36.0.1985.32 beta-m on Windows 8.1



  • I wanted to try it, but I have neither of those.


  • :belt_onion:

    @darkmatter said:

    Having your browser travel to a new page and lose your spot in an infinite-scroll thread is pretty high on the annoying meter.

    There's the option to open all links in a new window/tab (in the discourse preferences) which
    is what I enabled to save my sanity for the occasions where I forget the brilliant advice to stop doing it wrong [paraphrasing].

    @codinghorror said:

    Highlighting a link, then mouse release on link, is due to click tracking, which we don't want to do via re-writing all links to a link shortener. It is a limitation, but for the .0001% of the time you find yourself needing to highlight part of a link, can be an issue. Workaround: highlight beyond link, delete extra.



  • NB TDWTFers:

    @sam said:

    Filed under: <a>You can now release the mouse in the middle of a link and get a quote reply thingy</a>


  • SockDev

    @boomzilla said:

    NB TDWTFers:

    wait.... a discodev actually fixed a bug we filed?

    ALL GLORY AND HONOUR FOR THE NEXT 24 12 6 3 HOURS 90 45 MINUTES TO @SAM!

    (i'm assuming it was @sam who fixed that i cant see the linked topic)



  • It was sam, yes.


  • SockDev

    i knew i liked that guy for a reason. 😉



  • Can't seem to repro, did this get fixed? I didn't get a chance to test it until today (not possible to repro from mobile :P)



  • Yes, this has been fixed.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.