Skip to content

setOffsetOption bug #2519

cosmobile opened this Issue Aug 14, 2013 · 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

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
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.