fix(@react-aria/overlays): prevent exception on Cypress (#2341)
* fix(@react-aria/overlays): prevent exception on Cypress
Cypress screenshot command triggers a scroll event where the event target is window, not a DOM element.
closes #2340
* test(@react-aria/overlays): add two test case for close on scroll
related to #2340.
The first test case is related to the regression mentioned here: https://github.com/adobe/react-spectrum/pull/2341#discussion_r716888307
The second test case captures the fix for the cypress issue.
* window scroll to behave same as document
* remove comment that no longer applies
Co-authored-by: Robert Snow <rsnow@adobe.com>
Co-authored-by: Daniel Lu <dlu@livefyre.com>