Prevents a modal overlay that's not on top of the stack from closing when a user clicks outside of the overlay's ancestor path. For example, when there are two modal overlays stacked on top of each other, clicking on the top overlay will not close the one below it.
Additionally, clean up the reference to this.lastOverlay to prevent a memory leak.
Before the Overlay v2 API changes, overlays would behave as described above. It is unexpected for the overlay on the bottom to close on a random click, especially when the top overlay doesn't close.
How has this been tested?
We are actively testing this behavior in Express.
[ ] Test case 1
Go here
Do this
[ ] Test case 2
Go here
Do this
Screenshots (if appropriate)
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)
[x] I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.
Description
Prevents a modal overlay that's not on top of the stack from closing when a user clicks outside of the overlay's ancestor path. For example, when there are two modal overlays stacked on top of each other, clicking on the top overlay will not close the one below it.
Additionally, clean up the reference to
this.lastOverlay
to prevent a memory leak.Related issue(s)
Motivation and context
Before the Overlay v2 API changes, overlays would behave as described above. It is unexpected for the overlay on the bottom to close on a random click, especially when the top overlay doesn't close.
How has this been tested?
We are actively testing this behavior in Express.
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.