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(core): Avoid refreshing a host view twice when using transplanted… #53021

Closed
wants to merge 1 commit into from

Commits on Dec 6, 2023

  1. fix(core): Avoid refreshing a host view twice when using transplanted…

    … views
    
    This change fixes and issue where the expectation was that change
    detection always goes through `detectChangesInView`. In reality,
    `detectChangesInternal` directly calls `refreshView`
    and refreshes a view directly without checking if it was dirty (to my discontent).
    
    This update changes the implementation of `detectChangesInternal` to
    actually be "detect changes" not "force refresh of root view and detect
    changes". In addition, it adds the refresh flag to APIs that were
    previously calling `detectChangesInternal` so we get the same behavior
    as before (host view is forced to refresh).
    
    Note that the use of `RefreshView` instead of `Dirty` is _intentional_
    here. The `RefreshView` flag is cleared before refreshing the view while
    the `Dirty` flag is cleared at the very end. Using the `Dirty` flag
    could have consequences because it is a more long-lasting change to the
    view flags. Because `detectChangesInView` will immediately clear the
    `RefreshView` flag, this change is much more limited and does not
    result in a different set of flags during the view refresh.
    atscott committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    3fac113 View commit details
    Browse the repository at this point in the history