Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to stop browser from scrolling when text is selected? Potential browser bug?
    text
    copied!<p>I'm experiencing a strange issue with an app I'm working on... Whenever the user highlights text on a div that's been translated down the page a bit, the browser will instantly start scrolling up. It is really hard to describe so I've made an example page that exhibits the issue...</p> <p><a href="http://riskable.com/files/scroll_problem.html" rel="noreferrer">http://riskable.com/files/scroll_problem.html</a></p> <p>I've also uploaded the text to pastebin for easy viewing (and if I ever take that URL down later):</p> <p><a href="http://pastebin.com/ay6LUcfP" rel="noreferrer">http://pastebin.com/ay6LUcfP</a></p> <p>If you--by means of JavaScript--translate() both div1 and div2 back to their default positions the problem does not exhibit itself inside div1. It only occurs inside div2 and only when it is in front of the user (e.g. it has been transformed by a "translate()").</p> <p>I honestly think this might be a browser bug but I'm not certain since I'm not an ECMAScript or DOM expert. Any ideas?</p> <p><strong>EDIT:</strong> I have updated the HTML to work in both Firefox 4+ and Opera 11+ (-moz-transform and -o-transform, respectively). I have also created a new pastebin link for the updated script (the link has been updated). The problem doesn't appear to exhibit itself in either of those browsers so it appears to definitely be a Chrome bug.</p> <p><strong>EDIT 2:</strong> I have opened a bug report for this issue on the Chromium site: <a href="http://code.google.com/p/chromium/issues/detail?id=74318" rel="noreferrer">http://code.google.com/p/chromium/issues/detail?id=74318</a></p> <p>It is probably a bug in Webkit but I'll let the Chromium folks find out if that is the case.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload