From: Robert Sesek Date: Sun, 23 Feb 2014 03:55:17 +0000 (-0500) Subject: Bind mousedown to _selectPassword instead of click. X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=dc9c0cc809686e853042458fbab5fc27e91cd29d;p=skeletonkey.git Bind mousedown to _selectPassword instead of click. Event click is dispatched from touch events as well as mouse events, but the selection behavior only makes sense with pointing devices. --- diff --git a/core.js b/core.js index 189b082..747968e 100644 --- a/core.js +++ b/core.js @@ -69,8 +69,15 @@ SkeletonKey.prototype._init = function() { this._sitekey.onkeyup = this._nextFieldInterceptor.bind(this); this._username.onkeyup = this._nextFieldInterceptor.bind(this); - this._password.onclick = this._selectPassword.bind(this); - this._password.labels[0].onclick = this._selectPassword.bind(this); + this._password.onmousedown = this._selectPassword.bind(this); + this._password.labels[0].onmousedown = this._selectPassword.bind(this); + + function eatEvent(e) { + e.stopPropagation(); + e.preventDefault(); + } + this._password.onmouseup = eatEvent; + this._password.labels[0].onmouseup = eatEvent; if (this._isChromeExtension()) { this._initChromeExtension();