This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Protect against infinite recursion in focusOverlay.
An easy way to repro the infinite recursion is to create multiple _opened_ overlays, and dismiss them at the same time (toasts). Here's what's happening. Say there are two overlays (A, and B), that were dismissed at the same time - and that their transitions end within the same run loop tick: * `A.transitionend`: * Removed from `overlays`. * Calls `applyFocus`, which calls `focusOverlay`. * `focusOverlay` calls `B.applyFocus`: * `B.closed == false`, so `focusOverlay` is called again. * ...recurse. The main problem is that the overlay's state (`opened`) is set before the transition completes; but `focusOverlay` relies on it to determine what to do next. So, we defer work until after transitions are complete.
- Loading branch information