Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cdk-experimental/dialog): sync with recent material dialog c…
…hanges (angular#20178) We recently landed the MDC-based dialog. For this one, we changed how the dialog initializes the focus trap, saves the previously focused element, focuses the dialog container. Previously, all of this this has been performed before the content has been attached. The dialog used `Promise.resolve` to wait for the content to be attached. This has been cleaned up now so that the container is initialized properly (without the `Promise.resolve` trick) after the content has been attached. We initially did this in the MDC-based dialog PR through the `ngAfterViewInit` lifecycle hook, but that unveiled issues in g3 where the focus is moved too early to the container. We fixed this in the Material dialog by having an explicit `_initializeWithAttachedContent` method on the container. The change has just not been applied to the CDK dialog. This commit syncs the CDK dialog with the latest changes.
- Loading branch information