enyojs/moonstone — pull request #1355 by graynorton (2014-06-05 00:20:22+00:00)
Title: BHV-8502: Don't allow focus to escape moon.Popup in 5-way mode

We do this by adding onSpotlightFocus to the set of events that the popup captures when it's open. We inspect the captured event and decide (using the public Spotlight APIs for last and current focus) whether to allow focus to leave (and close the popup) or to keep focus inside.

This change required us to make eventsToCapture a concat'able property in enyo.Popup, so depends on https://github.com/enyojs/enyo/pull/749.

Making this change also allowed us to no longer rely on the onSpotlightContainerLeave event to close the popup, which in turn allowed us to get rid of the "spotlightDummy" DOM node formerly required for cases where nothing in the popup was spottable.