From dc9c0cc809686e853042458fbab5fc27e91cd29d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 22 Feb 2014 22:55:17 -0500 Subject: [PATCH] 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. --- core.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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(); -- 2.43.5