#5769 Can't select code via double- or triple-click

v1.2.0
closed
nobody
General
2015-08-20
2013-02-07
No

Whenever you click on a line in the code browser, it highlights it and sets the URL target to #lNNN which moves the page around. That prevents me from double-click to select one word or triple-clicking to select one line, because the page moves. I think it'd be best to not move the page when you click on a line, that is unexpected. We'd still want the highlight and URL target to be set though...

Discussion

  • Cory Johns - 2014-01-30

    You can't prevent the page from moving at least momentarily (enough to interfere with a double-click) when changing the URL target via window.location. On browsers that support it, you can use history.pushState() or history.replaceState() to do so, but it won't work in most versions of IE.

    I think the best option would be to delay the click handler to allow for the double-click to register before updating the URL target.

     
  • Cory Johns - 2014-01-30
    • labels: ux --> ux, bitesize
     
  • Cory Johns - 2014-01-30
    • Size: --> 1
     
  • Dave Brondsema

    Dave Brondsema - 2014-02-03
    • Labels: ux, bitesize --> bitesize, 42cc, ux
    • Status: open --> in-progress
     
  • Igor Bondarenko - 2014-02-11
    • status: in-progress --> code-review
     
  • Igor Bondarenko - 2014-02-11

    Closed #528. je/42cc_5769

    I think the best option would be to delay the click handler to allow for the double-click to register before updating the URL target.

    This works great in chrome, but unfortunately, firefox resets the selection after page move. We're implemented another approach - highlight line only if there was exactly one click. It works fine in both ff & chrome.

     
    • QA: Tim Van Steenburgh
    • Milestone: forge-backlog --> forge-feb-21
     
    • status: code-review --> closed
     
  • Dave Brondsema

    Dave Brondsema - 2015-01-05
    • Milestone: unreleased --> asf_release_1.2.0
     

Log in to post a comment.