Skip to content

Incorrect extra number of overlays with multiple dialog #2324

Closed

Description

@guojenman

Bug:

What is the expected behavior?

When instantiating multiple dialogs, there should be only one overlay and update it's z-index so that it's over the previous dialog

What is the current behavior?

One overlay is create for each dialog and all of the z-index are always 1 so that it never hides the previous still opened dialog

What are the steps to reproduce?

http://plnkr.co/edit/hQKwfp?p=preview

click open modal 1 on main app + click open modal 2 in opened dialog

  1. you can still interact with dialog 1
  2. you see the overlay darken because there are now 2 overlays

What is the use-case or motivation for changing an existing behavior?

  1. By creating a new overlay for each opened dialog, it darkens then look of the overlay for each on that is opened
  2. Should not be able to interact with dialog 1 until dialog 2 is closed, currently you can still click on "open modal 2" from dialog 1 which keeps creating dialog 2s and overlay keeps getting darker and darker for each overlay instantiated

Which versions of Angular, Material, OS, browsers are affected?

Material: 2.0.0-alpha.11-3
Angular: All

Is there anything else we should know?

Activity

  1. crisbeto commented on Dec 21, 2016

    @crisbeto
    Member

    I'm not sure I agree that only one dialog should be open at a time. That being said, the backdrop stacking issues should be solved with #2276

  2. guojenman commented on Dec 21, 2016

    @guojenman
    Author

    @crisbeto Overlay stacking described in #2276 may be close to what I'm saying, though after cloning from master and running "gulp build:components" and rebuilding my app to use that version, I see no difference with the overlays in my dialogs (2 opened sequentially and left opened)

    1. both overlays were still under both dialogs
    2. because there were two overlays, they looked darker

    IMO, both of these behavior are not correct. Maybe I'm not building from source correctly to see the change?

    There should be only 1 overlay no matter how many dialogs are opened. If for technical reasons we need to have 1 overlay per dialog, then all but the last overlay should have opacity of 0 so they don't ad to the darkness of the overlay.

  3. crisbeto commented on Dec 22, 2016

    @crisbeto
    Member

    Here's what it looks like for me on master @guojenman:

    1

    Regarding the overlays looking darker, I think that my example illustrates why it's necessary: when you have multiple dialogs and one doesn't overlap the other completely, you need some kind of indication that the lower one isn't clickable (hence the darkening). It might make sense to have a config option to be able to disable it, though.

  4. guojenman commented on Dec 22, 2016

    @guojenman
    Author

    @crisbeto your build looks like the right behavior. Thank you.

  5. angular-automatic-lock-bot commented on Sep 5, 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions