diff options
author | Scott González <scott.gonzalez@gmail.com> | 2017-02-19 10:52:27 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2017-02-21 12:45:19 -0500 |
commit | a3b9129be19afabb3fa6b2fb913b85aab43f4652 (patch) | |
tree | 39063d55018265e896165afdb07c4c631af07fed /ui | |
parent | 162377fba20f95fed81dde877833e5d432b246d1 (diff) | |
download | jquery-ui-a3b9129be19afabb3fa6b2fb913b85aab43f4652.tar.gz jquery-ui-a3b9129be19afabb3fa6b2fb913b85aab43f4652.zip |
Spinner: Ignore `mousewheel` events when not focused
Fixes #15139
Closes gh-1794
Diffstat (limited to 'ui')
-rw-r--r-- | ui/widgets/spinner.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/widgets/spinner.js b/ui/widgets/spinner.js index c63f4526a..0bc1db230 100644 --- a/ui/widgets/spinner.js +++ b/ui/widgets/spinner.js @@ -140,9 +140,13 @@ $.widget( "ui.spinner", { } }, mousewheel: function( event, delta ) { - if ( !delta ) { + var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ); + var isActive = this.element[ 0 ] === activeElement; + + if ( !isActive || !delta ) { return; } + if ( !this.spinning && !this._start( event ) ) { return false; } |