Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

requestAnimationFrame should return native handleId or cancelAF should accept TimerOption #360

Closed
lacolaco opened this issue Jun 13, 2016 · 6 comments

Comments

@lacolaco
Copy link

lacolaco commented Jun 13, 2016

From angular/angular#8401

Currently, zone-patched requestAnimationFrame returns ZoneTask.

It seems breaking native rAF canceling:

let handleId = requestAnimationFrame(fn);
cancelAnimationFrame(handleId); // not canceled

To cancel rAF, we have to use data.handleId

let timerOption = requestAnimationFrame(fn);
cancelAnimationFrame(timerOption.data.handleId);
@lacolaco lacolaco changed the title requestAnimationFrame should return native handleId requestAnimationFrame should return native handleId or cancelAF should accept TimerOption Jun 13, 2016
@lacolaco
Copy link
Author

Repro (with Angular2): http://plnkr.co/edit/MmQmT8YAbOyg8kh3pnQX?p=preview

@sebholstein
Copy link

Maybe related to #359

@b-strauss
Copy link

I think zone.js should not change the signature of any native APIs. Is there a list of all patches that do not preserve the original signature?

@lacolaco
Copy link
Author

lacolaco commented Jun 15, 2016

AFAIK, set/clearInterval and set/clearTimeout seems working as well as its native behavior.

@lacolaco
Copy link
Author

@IgorMinar how do you think about this?

@lacolaco
Copy link
Author

lacolaco commented Aug 22, 2016

Fixed in latest zone.js. http://plnkr.co/edit/JJCleR?p=preview
Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants