Skip to content

Commit

Permalink
Fix for alvarotrigo#3931 (normalScrollElements option)
Browse files Browse the repository at this point in the history
There is a fix for the issue alvarotrigo#3931, that appears when "normalScrollElements" option is added and mouse cursor leaves from a browser window.

When the mouse cursor left the viewport, the "scrollable" variable was not assigned a value, because the "target" parameter, in this case, is null. So, I just added a check for the "target" parameter value in 2409 line.
  • Loading branch information
AlekseiKrivo authored May 11, 2020
1 parent 650d52f commit e2327af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendors/scrolloverflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2406,7 +2406,7 @@ if ( typeof module != 'undefined' && module.exports ) {

// Enables or disables the whole iScroll feature based on the given parameter.
setIscroll: function(target, enable){
if(!iscrollHandler.hasBeenInit){
if(!iscrollHandler.hasBeenInit || !target){
return;
}
var scrollable = fp_utils.closest(target, SCROLLABLE_SEL) || $(SCROLLABLE_SEL, target)[0];
Expand Down Expand Up @@ -2599,4 +2599,4 @@ if ( typeof module != 'undefined' && module.exports ) {
iscrollHandler: iscrollHandler
};
})();
})(window, document);
})(window, document);

0 comments on commit e2327af

Please sign in to comment.