Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay supports repositioning upon resize / scroll #1430

Closed
jelbourn opened this issue Oct 5, 2016 · 18 comments
Closed

Overlay supports repositioning upon resize / scroll #1430

jelbourn opened this issue Oct 5, 2016 · 18 comments
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P2 The issue is important to a large percentage of users, with a workaround

Comments

@jelbourn
Copy link
Member

jelbourn commented Oct 5, 2016

As of now, overlays only position themselves once (and when told to reposition through the OverlayRef).

This issue tracks overlays being able to automatically reposition themselves when scrolling or resize.

@jelbourn jelbourn added feature This issue represents a new feature or feature request rather than a bug or bug fix P2 The issue is important to a large percentage of users, with a workaround labels Oct 5, 2016
@jelbourn jelbourn self-assigned this Oct 5, 2016
@fxck
Copy link
Contributor

fxck commented Nov 9, 2016

Any ETA on this?

@fxck
Copy link
Contributor

fxck commented Nov 14, 2016

@jelbourn almost all components that use overlay look broken because this doesn't work.. it seems like a pretty high priority thing to me. Do you want to work on this internally, or I can try and make a PR?

@jelbourn
Copy link
Member Author

@fxck This is something we plan to work on- I have a specific approach in mind.

@fxck
Copy link
Contributor

fxck commented Nov 18, 2016

and do you have it written down somewhere? @jelbourn

@fxck
Copy link
Contributor

fxck commented Nov 30, 2016

@jelbourn this is such a pain in the ass.. can you please share what you have in mind so I can give it a shot?

Is it what's in https://docs.google.com/document/d/1jSMjkKSdzbQa2cuCeSFpzFAwDHr7xY4eqsXkfF6MeqA/preview or something else entirely?

Even this

If you want to position an overlay relative to some static element whose only scrolling container is the document body, everything works great after scroll (example).

is not true anymore though, as md-overlay-container has position: fixed now

@jelbourn
Copy link
Member Author

It's mostly what's in the doc.

@crisbeto has been exploring the "disable scrolling" option in #1971 and @andrewseguin is already working on the repositioning.

@jelbourn jelbourn assigned andrewseguin and unassigned jelbourn Nov 30, 2016
@mycarrysun
Copy link

Stumbled upon this issue because I am trying to figure out why the MdDialog is position:static (changing to absolute fixes it...kind of). The overlay is on top of the dialog and the dialog is full width of the page (no width is declared in my config). Is this broken or do I need to do something to get it to work? I can fix it by adding display:flex and height: 100% to the .md-global-overlay-wrapper, but not sure if that is the correct way to go about it.

@crisbeto
Copy link
Member

Try clearing your node_modules @mycarrysun. There have been a few similar issues after the latest release.

@mycarrysun
Copy link

Hmm strange, it worked though! Thanks @crisbeto

@k3nsei
Copy link

k3nsei commented Jan 10, 2017

@jelbourn If menu is open indeed scroll is disabled. But only if you using mouse roller. But there are other options to scroll. For example by pressing up, down, pageUp, pageDown, home and end keys.

@jelbourn
Copy link
Member Author

#2703 adds this for tooltip. Once that is in, subsequent PRs can add this to menu and select.

@aldo-roman
Copy link

Hi @jelbourn, any update on this issue? It's been 2 months now. Thanks!

@jelbourn
Copy link
Member Author

jelbourn commented May 4, 2017

This issue is now replaced by #4093

@jelbourn jelbourn closed this as completed May 4, 2017
@marcusreese
Copy link

marcusreese commented Apr 10, 2018

@jelbourn You mentioned this issue is replaced by 4093, which is "Overlay-based components should handle page scroll gracefully." I'm sure you're right, but I'm not understanding what to do to handle resize events (since this closed issue is called "Overlay supports repositioning upon resize / scroll"). Would you clarify for those like myself who were searching the internet for how to handle problems in angular cdk overlay when the user resizes the window? For example, I see a CloseScrollStrategy that will close the overlay as soon as the user starts scrolling. Is there such a thing for resize, like a CloseResizeStrategy? Or some other way to approach that problem?

@jelbourn
Copy link
Member Author

There isn't anything that does resize automatically; we don't consider it to be as core of a use-case. The Material Design team did some user studies at some point and found that the only people who really resize their browser windows are web developers.

@marcusreese
Copy link

Okay, well I'll probably use @HostListener('window:resize') or fromEvent and in the callback do overlay.dispose();

@AFDevMike
Copy link

For those looking for window:resize/ post attach change possition solution; there is now OverlayRef.updatePositionStrategy() which can be called before OverlayRef.updatePosition()

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

No branches or pull requests

9 participants