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

fix(material/dialog): autofocus should wait for rendering to complete #28330

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Dec 26, 2023

  1. fix(material/dialog): autofocus should wait for rendering to complete

    The current implementation of the dialog's `finishDialogOpen`, which
    includes autofocus, only waits for a microtask before executing. This
    only works in the tests because of the synchronous call to
    `detectChanges` after opening the dialog, ensuring that change detection
    runs before the microtask. In an application, this is not guaranteed
    because `NgZone` will only run change detection when the microtask queue
    empties, which includes the microtask created by the dialog container.
    
    This commit updates the implementation to wait for the next render to
    coplete, _then_ queues a microtask that will finish the open process and
    perform autofocus.
    atscott committed Dec 26, 2023
    Configuration menu
    Copy the full SHA
    c721426 View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2024

  1. Configuration menu
    Copy the full SHA
    4ee0a82 View commit details
    Browse the repository at this point in the history