fix: focusAsync still works even if past animationFrame fails to run#29322
Merged
smhigley merged 3 commits intomicrosoft:masterfrom Sep 28, 2023
Merged
fix: focusAsync still works even if past animationFrame fails to run#29322smhigley merged 3 commits intomicrosoft:masterfrom
smhigley merged 3 commits intomicrosoft:masterfrom
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f6c48f8:
|
fabricteam
reviewed
Sep 28, 2023
Collaborator
📊 Bundle size report🤖 This report was generated against 8dd29fff580dac6fe127b2f23ebd4bd6ed1f46f9 |
Asset size changes
Baseline commit: 8dd29fff580dac6fe127b2f23ebd4bd6ed1f46f9 (build) |
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| BaseButton | mount | 637 | 674 | 5000 | |
| Breadcrumb | mount | 1729 | 1763 | 1000 | |
| Checkbox | mount | 1713 | 1693 | 5000 | |
| CheckboxBase | mount | 1511 | 1469 | 5000 | |
| ChoiceGroup | mount | 2938 | 2931 | 5000 | |
| ComboBox | mount | 650 | 666 | 1000 | |
| CommandBar | mount | 6430 | 6517 | 1000 | |
| ContextualMenu | mount | 16159 | 16526 | 1000 | |
| DefaultButton | mount | 738 | 755 | 5000 | |
| DetailsRow | mount | 2231 | 2207 | 5000 | |
| DetailsRowFast | mount | 2173 | 2250 | 5000 | |
| DetailsRowNoStyles | mount | 2065 | 2049 | 5000 | |
| Dialog | mount | 2657 | 2766 | 1000 | |
| DocumentCardTitle | mount | 232 | 246 | 1000 | |
| Dropdown | mount | 2005 | 1987 | 5000 | |
| FocusTrapZone | mount | 1092 | 1161 | 5000 | |
| FocusZone | mount | 1087 | 1078 | 5000 | |
| GroupedList | mount | 42300 | 42398 | 2 | |
| GroupedList | virtual-rerender | 20149 | 20354 | 2 | |
| GroupedList | virtual-rerender-with-unmount | 53093 | 52000 | 2 | |
| GroupedListV2 | mount | 232 | 231 | 2 | |
| GroupedListV2 | virtual-rerender | 215 | 220 | 2 | |
| GroupedListV2 | virtual-rerender-with-unmount | 238 | 241 | 2 | |
| IconButton | mount | 1082 | 1062 | 5000 | |
| Label | mount | 340 | 344 | 5000 | |
| Layer | mount | 2796 | 2770 | 5000 | |
| Link | mount | 408 | 392 | 5000 | |
| MenuButton | mount | 938 | 953 | 5000 | |
| MessageBar | mount | 21647 | 21804 | 5000 | |
| Nav | mount | 1951 | 1956 | 1000 | |
| OverflowSet | mount | 788 | 787 | 5000 | |
| Panel | mount | 2073 | 1782 | 1000 | |
| Persona | mount | 732 | 735 | 1000 | |
| Pivot | mount | 852 | 847 | 1000 | |
| PrimaryButton | mount | 849 | 856 | 5000 | |
| Rating | mount | 4615 | 4644 | 5000 | |
| SearchBox | mount | 899 | 914 | 5000 | |
| Shimmer | mount | 1897 | 1900 | 5000 | |
| Slider | mount | 1360 | 1321 | 5000 | |
| SpinButton | mount | 2950 | 2838 | 5000 | |
| Spinner | mount | 395 | 390 | 5000 | |
| SplitButton | mount | 1824 | 1826 | 5000 | |
| Stack | mount | 417 | 416 | 5000 | |
| StackWithIntrinsicChildren | mount | 842 | 877 | 5000 | |
| StackWithTextChildren | mount | 2644 | 2650 | 5000 | |
| SwatchColorPicker | mount | 6164 | 6234 | 5000 | |
| TagPicker | mount | 1512 | 1541 | 5000 | |
| Text | mount | 365 | 391 | 5000 | |
| TextField | mount | 942 | 957 | 5000 | |
| ThemeProvider | mount | 840 | 853 | 5000 | |
| ThemeProvider | virtual-rerender | 596 | 583 | 5000 | |
| ThemeProvider | virtual-rerender-with-unmount | 1283 | 1284 | 5000 | |
| Toggle | mount | 619 | 616 | 5000 | |
| buttonNative | mount | 191 | 199 | 5000 |
spmonahan
approved these changes
Sep 28, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 came up while helping a partner debug why focus wasn't entering
ContextualMenuafter closing & re-opening an email window. It turns out that the current implementation offocusAsyncfails to call focus if a previous call offocusAsyncsettargetToFocusOnNextRepaintbut didn't runwin.requestAnimationFrame(e.g. because the window closed).By saving the
requestAnimationFrameand cancelling prior ids on subsequent same-animation-frame calls, we can ensure that a past not-runfocusAsyncdoes not prevent future focus calls.