Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


setOffsetOption bug #2519

cosmobile opened this Issue · 2 comments

4 participants


Hi, I found what I think is a bug in thst method of Element.Position class (Mootools 1.4.5).
In the beginning of the function:

setOffsetOption: function(element, options){
var parentOffset = {x: 0, y: 0},
offsetParent = element.measure(function(){
parentScroll = offsetParent.getScroll();

the last line would be:
parentScroll = (offsetParent!=null)?offsetParent.getScroll():null;
because offsetParent could be null (getOffsetParent() could return null) and in this case all crashes because it throws an error "Cannot call method 'getScroll' of null".

Hope it would be helpful, good work


Provide a JSFiddle showing this issue please.

@ibolmo ibolmo added this to the 1.5.1 milestone
@ibolmo ibolmo removed the enhancement label

This is related to MooTools More and has already it's own issue. Closing it here,
Thanks @cosmobile for bringing it up.

@arian arian added the invalid label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.