Skip to content

setOffsetOption bug #2519

Closed
cosmobile opened this Issue Aug 14, 2013 · 2 comments

4 participants

@cosmobile

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(){
return document.id(this.getOffsetParent());
}),
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

@ibolmo
MooTools member
ibolmo commented Mar 3, 2014

Provide a JSFiddle showing this issue please.

@ibolmo ibolmo added this to the 1.5.1 milestone Mar 3, 2014
@ibolmo ibolmo removed the enhancement label Mar 3, 2014
@SergioCrisostomo
MooTools member

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 Mar 25, 2014
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.