Discourse 'reinvents' highlighting on keyboard



  • Jesus monkey bladders, you guys just have to reinvent shit, don't you?

    OK, so here's the context. I was trying to copy the URL to the joker image as mentioned in this post and I missed one character by my mouse.

    No problem, I thought, I'll just adjust it with shift+arrows. I needed to extend it by one character left, so shift+left should have been sufficient... except clumsily I pressed it too long and ended up with an extra character.

    Now, in Chrome on OS X where I am now, shift+right should have gone back a character. Same as it would on Windows. Except in Discourse, shift+right extends the right edge of the selection and shift+left extends the left edge of the selection in the main body of things.

    Oh wait, sorry, no, it doesn't just blindly extend left/right edges, it only does it sporadically when you're about to quote, sometimes it will extend the edges of the selection, sometimes it will bring the edge back a character, but only if you extended it first. I don't know how the rules work on this but seriously, another browser behaviour you just have to override?


  • :belt_onion:

    Can't repro, closed topic, clearly your browser is inferior or you're doing it wrong.
    : img of lulz :


  • BINNED

    @Arantor said:

    but seriously, another browser behaviour you just have to override?

    Yes, you're welcome.



  • No, it's not the browser, because Chrome does it normally in other webpages that don't try to munge what the user wanted to do.


  • :belt_onion:

    I'm using chrome.



  • So am I. Chrome behaves normally on other pages.

    Are you trying to do this on the body of a post with 'enable quote reply on highlighted text' enabled?


  • :belt_onion:

    Yes. works exactly correctly, shift+right arrow adds a a character to the right side of my highlight, shift+left arrow takes that character out of my highlight.



  • @darkmatter said:

    Yes. works exactly correctly, shift+right arrow adds a a character to the right side of my highlight, shift+left arrow takes that character out of my highlight.

    Same here.



  • FUCKING HELL WHY DOES IT MOVE TWO CHARACTERS WHEN I HIT Shift + Left ONCE

    Also:

    Damn, this thing shouldn't be out of the alpha stage yet, let alone close-to-release-beta.



  • Sometimes it does that for me, sometimes it doesn't. I cannot figure out a pattern as to how it might.


  • :belt_onion:

    @Arantor said:

    at for me, sometimes it doesn't. I cannot figur

    Even better, type some stuff into a reply, then accidentally hit CTRL+H. Now hit CTRL+Z. Too freaking bad, sucker.

    Heading #### Heading



  • Awesome, I get even more inconsistent behaviour because currently I'm on OS X where CtrlZ doesn't do anything because it's CmdZ instead.



  • @Arantor said:

    currently I'm on OS X

    I FOUND THE PROBLEM!


  • ♿ (Parody)

    @Arantor said:

    Are you trying to do this on the body of a post with 'enable quote reply on highlighted text' enabled?

    Works as expected for me in Chrome on Linux. Sounds like some sort of OSXWTF.


    Filed Under: BBQ



  • Funny, but no, since Chrome behaves exactly as expected in every other tab, even in the editor it behaves as I expect. It's only in the quote-reply nonsense where it behaves any differently.



  • I've tried testing it, but I can't reproduce your issue either (tested on Chrome 35 on Windows 8.1). The behaviour seems to depend on how I selected the text, but it doesn't matter where I do so.

    If I select text anywhere on the page from left to right and use Shift+, then my selection is reduced from the right side by the amount of key presses. If I select text from right to left and press Shift+, then my selection is extended towards the left of the selected text.

    There seems to be a bug however: when the "quote reply" button disappears, my selection is destroyed and I can't continue selecting text on the other side of the caret. In other Windows programs (such as Notepad or Word), the caret continues to move to the left and expands the selection there, but not so on Discourse. I'm guessing this has something to do with DOM manipulation.


  • :belt_onion:

    Interesting indeed.
    If I highlight upwards back across 2 posts so I get no "Quote Reply" popup, then using
    Shift+ expands/contracts the left side of my selection.
    Once I move far enough to not be highlighting 2 posts anymore, the "Quote Reply" box pops up and then it starts only expanding the right side of my selection.



  • @Keith said:

    @Arantor said:
    currently I'm on OS X

    I FOUND THE PROBLEM!

    Hilariously enough... I can reproduce it on Chrome and Safari for OS X (and only OS X), and can confirm @Arantor's posit that it only occurs on Discourse, as other sites (disclosure, I only tested two others) don't exhibit the same issue. The only difference I can see is:

    @Arantor said:

    shift+right extends the right edge of the selection and shift+left extends the left edge of the selection in the main body of things

    I had it sometimes following what is expected (shift+left reduces the right edge of the selection), but if I kept on it, it would switch to extending the left side, and if I'd try and go back and forth between left and right, sometimes it would reduce the side of the selection it previously extended before switching and extending the other side.



  • I'm pretty sure that what's happening here is that it copies the text of your selection into a hidden div somewhere, then recreates the selection in a sorted state.

    :\


Log in to reply