Skip to main content

Bug Tracker

Side navigation

#7931 closed bug (fixed)

Opened January 09, 2011 11:15PM UTC

Closed April 12, 2011 08:14PM UTC

scrollTop and scrollLeft setters return null when called on empty jquery object

Reported by: anonymous Owned by: Xavi-
Priority: high Milestone: 1.6
Component: offset Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

Both the $.fn.scrollTop and $.fn.scrollLeft setters return null when called on an empty jquery object. This leads to unexpected null pointer exceptions. Example:

#!js
// Causes null pointer exception
$(".does-not-exists").scrollTop(100).addClass("scrolled");

This is also inconsistant behavior. Most jquery setters (e.g. height, width, addClass, attr, css, etc...) always return jquery objects.

Attachments (0)
Change History (4)

Changed January 10, 2011 12:17AM UTC by anonymous comment:1

Changed January 18, 2011 01:36PM UTC by rwaldron comment:2

component: unfiledoffset
owner: → Xavi-
priority: undecidedhigh
status: newassigned

Changed February 28, 2011 11:23AM UTC by jitter comment:3

#8391 is a duplicate of this ticket.

Changed April 12, 2011 08:14PM UTC by john comment:4

milestone: 1.next1.6
resolution: → fixed
status: assignedclosed

Landed.