-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use the Dialog's parent as the root for the Intersection observer We have some code that allows us to auto-close the dialog the moment it gets hidden. This is useful if you use a dialog for a mobile menu and you resizet he browser. If you wrap the dialog in a `md:hidden` then it auto closes. If we don't do this, then the dialog is still locking the scrolling, keeping the focus in the dialog, ... but it is not visible. To solve this we use an `IntersectionObserver` to verify that the `boundingClientRect` is "gone" (x = 0, y = 0, width = 0 and height = 0). However, the intersection observer is not always triggered. This happens if the main content is scrollable. Setting the `root` of the `IntersectionObserver` to the parent of the `Dialog` does seem to solve it. Not 100% sure what causes this behaviour exactly. * use a `ResizeObserver` instead of `IntersectionObserver` * implement a `ResizeObserver` for the tests * update changelog
- Loading branch information
1 parent
d1ca3a9
commit 9ecd8dd
Showing
6 changed files
with
10 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters