Skip to content

bug(dialog): afterOpened not always emitted #26295

Open
@romainmoreau

Description

@romainmoreau

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

14

Description

afterOpened is not emitted when the dialog is closed too fast.

Reproduction

I noticed this issue running some e2e tests but it also can be manually reproduced: basically just go to https://stackblitz.com/edit/afteropened-not-always-emitted-15 and double click on the button.

Expected Behavior

afterOpened should always emit a value before closing the dialog like in v14.

https://stackblitz.com/edit/afteropened-not-always-emitted-14

Actual Behavior

afterOpened is not emitted when the dialog is closed too fast.

https://stackblitz.com/edit/afteropened-not-always-emitted-15

Environment

  • Angular: 15.0.4
  • CDK/Material: 15.0.3
  • Browser(s): Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Activity

crisbeto

crisbeto commented on Dec 25, 2022

@crisbeto
Member

Currently this is working as expected. afterOpened emits after the opening sequence has finished which doesn't happen if you close it too quickly.

romainmoreau

romainmoreau commented on Dec 25, 2022

@romainmoreau
Author

It should be possible to simulate the previous behavior by combining beforeClosed and afterOpened but I think the behavior in v14 made more sense because it was simplier and more intuitive:

Diagramme sans nom drawio(2)

Maybe at least it should be mentionned somewhere because it silently breaks code migrated to v15 expecting afterOpened to be always emitted.

added
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
needs: discussionFurther discussion with the team is needed before proceeding
and removed
needs triageThis issue needs to be triaged by the team
on May 3, 2023
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

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/dialogneeds: discussionFurther discussion with the team is needed before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @romainmoreau@crisbeto@wagnermaciel

        Issue actions

          bug(dialog): afterOpened not always emitted · Issue #26295 · angular/components