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
Focus side effect type added; auto-focus moved to commit phase
Auto-focus was previously managed by ReactDOMFiberComponent.setInitialProperties which was called during the complete phase. This did not work because host components are not yet present in the DOM until the entire tree has been mounted which happens during the commit phase. This changeset moves focus management to the latter part of commit and tracks it via a new side effect type, .
I was able to reproduce the failing focus before in a browser and verify this fix. However it was a bit awkward to catch in a unit test because PhantomJS does not require DOM elements to be mounted in order to track their focused state. I've added a test that fails before and passes after, but it's kind of a hack.
As a side note I see that we are still using the focusNode helper mehtod in a few places. It seems like this is no longer neceessary since we dropped IE8 support early 2016. I did not remove it in this commit though since it's done in a few places.
0 commit comments