From e9fcc0f02a1ba8e0b345f4b5424a6fb645e916e7 Mon Sep 17 00:00:00 2001 From: Hyunje Alex Jun Date: Tue, 11 Nov 2014 13:29:09 +0000 Subject: [PATCH] Temporary fix for mousewheel problem of select in FF and IE. Resolve #247. --- src/perfect-scrollbar.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 3935d8b..9e5c2ee 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -52,6 +52,8 @@ }; }; + var isWebkit = 'WebkitAppearance' in document.documentElement.style; + $.fn.perfectScrollbar = function (suppliedSettings, option) { return this.each(function () { @@ -363,6 +365,13 @@ } function mousewheelHandler(e) { + // FIXME: this is a quick fix for the select problem in FF and IE. + // If there comes an effective way to deal with the problem, + // this lines should be removed. + if (!isWebkit && $this.find('select:focus').length > 0) { + return; + } + var delta = getDeltaFromEvent(e); var deltaX = delta[0];