You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds back the focussing of elements, this now only happens after committing the root rather than performing this check on every phase of child-diffing. This PR mainly checks whether it's worth the byte-size and to start a discussion
perf impact here is not worthwhile IMO, since it impacts performance on every diff regardless of whether focus needed to be restored.
I'd love to come up with a way to have the diff avoid losing focus in this case, but the problem I see is that it would always be specific to focus state. It would never fix things like <video> playback stopping or <iframe> being reloaded. The problem is that it's impossible to determine whether one DOM element is "more stateful" than any other DOM element.
Here's a particularly fun case where, no matter what we do, at least one of the iframes will be reloaded:
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds back the focussing of elements, this now only happens after committing the root rather than performing this check on every phase of
child-diffing
. This PR mainly checks whether it's worth the byte-size and to start a discussionFixes #4235
Fixes #3242