fix(overlay): do not hide overlay by default when clipped by ancestors #952
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
Describe the new behavior?
The default state for the overlay
hide
property is now set to"never"
(instead of"anchor-hidden"
). This tells the overlay not to hide itself when its anchor element is hidden from view via a clipping container (typically a scrollable parent element/containing block).The reason for this change is due to inconsistencies in detecting clipping ancestors across browsers. This functionality is an implementation detail behind most other popover-based components, and can be enabled if a developer chooses to use the low level overlay component directly, but otherwise this change should be transparent.
The only noticeable difference is if you scroll an anchor element while an attached overlay is open, but the anchor element is scrolled out of view, the overlay will no longer automatically hide itself by default. This is likely a more intuitive default anyway.