angular / angular/components

Full-screen overlay container doesn't work when fullscreen element is within an overlay

Open
#10,679 15 comments 3 reactions 0 assignees View on GitHub
area: cdk/overlay P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Bug, feature request, or proposal:
I believe this might be a bug.
In this example I try to load a snackbar into a container using the `viewContainerRef` config.
https://stackblitz.com/edit/angular-material-tooltip-in-container

#### What is the expected behavior?
The snackbar should align itself to the viewContainerRef that is provided.

#### What is the current behavior?
But the `_createOverlay` function does not look at this config and always creates the overlay using the `GlobalPositionStrategy` instead of `ConnectedPositionStrategy`.

There could be another root cause, and if there is please let me know.

#### What are the steps to reproduce?
I have provided a stackblitz above.

#### What is the use-case or motivation for changing an existing behavior?
There is a hand full of times i would like to load the snackbar in a container.
One in particular is the div has been maximized to full screen (so the window is not visible).
Therefore the snackbar is not visible.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
latest.

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and the `_createOverlay` entry point. Trace how the snackbar's `viewContainerRef` configuration is handled versus the global and connected position strategies, then verify that a snackbar is visible and aligned inside a full-screen overlay container.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.