Ticket #2531760 (closed defect)

Reporter


Steven Olmsted
Opened: 02/2/12
Last modified: 04/17/12
Status: closed
Type: defect
Resolution: fixed

Owner


Eric Ferraiuolo
Target Release: 3.5.0
Priority: P3 (normal)
Summary: Rapid calls to showView break app transitions
Description:

When consecutive calls to showView happen very quickly, the new view that is in the middle of an entrance transition from the first call can begin an exit transition from the second call. It appears
that the simultaneous transitioning of the view interferes with the transition complete callbacks. This prevents the view from being detached properly and probably has other side-effects.

Here is an example: http://jsfiddle.net/xThPX/1/

If Router is hooked up to a menu of links, and each route calls showView, it's possible for a quick clicking user to trigger this. Especially if the transition's durations are increased for a
particular fancy effect.

Type: defect Observed in Version: 3.5.0pr2
Component: App Framework Severity: S3 (normal)
Assigned To: Eric Ferraiuolo Target Release: 3.5.0
Location: Priority: P3 (normal)
Tags: app, callback, transition, view Relates To:
Browsers: Firefox - Latest,Chrome
URL: http://jsfiddle.net/xThPX/1/
Test Information:

This fiddle creates two simple views and an app. showView is then called many times with only a short timeout in between each call. The view instances aren't detached from the DOM properly after
their exit transition is complete.

Change History

Ryan Grove

YUI Developer

Posted: 02/2/12

Eric Ferraiuolo

YUI Developer

Posted: 02/2/12
  • milestone changed to 3.5.0
  • status changed from assigned to accepted

Eric Ferraiuolo

YUI Developer

Posted: 03/5/12

Steven,

I've investigated this further and you're right about the transition callbacks not getting called when you attempt to transition the same node multiple times before it completes. It actually behaves very odd :-/ I'm not sure the best way to deal with this, but resorting to a queue looks like it will be the safest thing to do. The drawback to the queue approach is that things will have to wait until the current running transition completes before jumping ahead to the latest item added to the queue.

It doesn't look like I can get this in for PR3, but I'm still shooting to get a solution in for GA.

Eric Ferraiuolo

YUI Developer

Posted: 03/5/12
  • status changed from accepted to checkedin

I was able to figure this out for PR3 o/

Eric Ferraiuolo

YUI Developer

Posted: 03/5/12
  • resolution changed to fixed

App.Transitions now handles rapid calls to `showView()`. Fixes #2531760
View Commit: d9d247a8a6f960720e449399984fa3be10134d61

Jenny Donnelly

YUI Developer

Posted: 04/17/12
  • status changed from checkedin to closed

Closing out bugs checked in to 3.5.0.