Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

setOffsetOption bug #2519

Closed
cosmobile opened this Issue · 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
Owner

Provide a JSFiddle showing this issue please.

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

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.