Ticket #2528239 (closed defect)

Reporter


Luke Smith
Opened: 09/10/09
Last modified: 09/29/09
Status: closed
Type: defect
Resolution: fixed

Owner


Adam Moore
Target Release: 3.0.0 GA
Priority: P3 (normal)
Summary: The detach handle returned from Y.onAvailable doesn't stop the deferred code from executing
Description:

var handle = Y.Event.onAvailable('#notYetOnThePage', function () {
alert('the element is on the page');
}, Y.Event, true, false);

handle.detach();

The alert will still occur when the element is added to the page.

This call to onAvailable is used by event and at least mouseenter/mouseleave and typing-pause to defer the subscription of events to elements when Y.on is passed a selector string that finds no
elements. Though the use in these cases may be flawed (see bug #2528236), calling detach should at least clear the pending function from Event's _avail array.

Type: defect Observed in Version: development master
Component: Event Severity: S3 (normal)
Assigned To: Adam Moore Target Release: 3.0.0 GA
Location: Library Code Priority: P3 (normal)
Tags: Relates To: #2528236
Browsers: N/A
URL:
Test Information:

Change History

Adam Moore

YUI Contributor

Posted: 09/10/09
  • milestone changed to 3.1.0
  • status changed from new to accepted

Adam Moore

YUI Contributor

Posted: 09/16/09
  • milestone changed from 3.1.0 to 3.0.0 GA

Adam Moore

YUI Contributor

Posted: 09/16/09
  • resolution changed to fixed
  • status changed from accepted to checkedin

all event listeners configured to return an event handle will always get a single object. Previously, requests that resulted in multiple listeners returned an array. onAvailable and lazy DOM listener detach handles now work as expected. [fixes #2528236]. [fixes #2528239].
View Commit: bc8660dcb747bedc141ca9061de83f6f32f8018f

Adam Moore

YUI Contributor

Posted: 09/16/09

all event listeners configured to return an event handle will always get a single object. Previously, requests that resulted in multiple listeners returned an array. onAvailable and lazy DOM listener detach handles now work as expected. [fixes #2528236]. [fixes #2528239].
View Commit: bc8660dcb747bedc141ca9061de83f6f32f8018f

George

YUI Developer

Posted: 09/29/09
  • status changed from checkedin to closed