Skip to content

Overlay supports repositioning upon resize / scroll #1430

Closed

Description

@jelbourn

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.

Activity

  1. added
    feature
    P2
    on Oct 5, 2016
  2. self-assigned this
    on Oct 5, 2016
  3. fxck commented on Nov 9, 2016

    @fxck
    Contributor

    Any ETA on this?

  4. fxck commented on Nov 14, 2016

    @fxck
    Contributor

    @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?

  5. jelbourn commented on Nov 15, 2016

    @jelbourn
    ContributorAuthor

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

  6. fxck commented on Nov 18, 2016

    @fxck
    Contributor

    and do you have it written down somewhere? @jelbourn

  7. fxck commented on Nov 30, 2016

    @fxck
    Contributor

    @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

  8. jelbourn commented on Nov 30, 2016

    @jelbourn
    ContributorAuthor

    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.

  9. mycarrysun commented on Dec 12, 2016

    @mycarrysun

    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.

  10. crisbeto commented on Dec 12, 2016

    @crisbeto
    Member

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

  11. mycarrysun commented on Dec 12, 2016

    @mycarrysun

    Hmm strange, it worked though! Thanks @crisbeto

  12. k3nsei commented on Jan 10, 2017

    @k3nsei

    @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.

  13. jelbourn commented on Jan 27, 2017

    @jelbourn
    ContributorAuthor

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

  14. aldo-roman commented on Mar 30, 2017

    @aldo-roman

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

  15. jelbourn commented on May 4, 2017

    @jelbourn
    ContributorAuthor

    This issue is now replaced by #4093

  16. marcusreese commented on Apr 10, 2018

    @marcusreese

    @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?

  17. jelbourn commented on Apr 10, 2018

    @jelbourn
    ContributorAuthor

    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.

  18. marcusreese commented on Apr 11, 2018

    @marcusreese

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

  19. AFDevMike commented on Jan 17, 2019

    @AFDevMike

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

  20. angular-automatic-lock-bot commented on Sep 10, 2019

    @angular-automatic-lock-bot

    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.

  21. locked and limited conversation to collaborators on Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions