-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Do not virtualize items around the last focused item #32646
Closed
Closed
Commits on Jul 19, 2022
-
Enable Generic Discontiguous Regions within VirtualizedList
Builds upon the `CellRenderMask` data structure added with facebook#31420, and VirtualizedList coverage added with facebook#31401. VirtualizedList currently keeps a [first, last] range as state, tracking the region of cells to render. The render functions uses this as an input, along with a few special cases to render more (sticky headers, initial render region.) This change moves to instead keep state which describes discontiguous render regions. This mask is continually updated as the viewport changes, batch renders expand the region, etc. Special cases are baked into the render mask, with a relatively simple tranformation from the mask to render function. This representation makes it much easier to support keyboarding scenarios, which require keeping distinct regions (e.g. for last focused) realized while out of viewport. MS/FB folks have a video discussion about VirtualizedList here: https://msit.microsoftstream.com/video/fe01a1ff-0400-94b1-d4f1-f1eb924b1809 facebook#31401 added quite a few snapshot tests, centering around the logic this change is touching. I manually validated RNTester FlatList examples (and their should be some upstream UI testing for them).
Configuration menu - View commit details
-
Copy full SHA for 19cb111 - Browse repository at this point
Copy the full SHA 19cb111View commit details -
Do not virtualize items adjacent to the last focused item
This change also includes the contents of facebook#32638 This change makes VirtualizedList track the last focused cell, through the capture phase of `onFocus`. It will keep the last focus cell, and its neighbors rendered. This allows for some basic keyboard interactions, like tab/up/down when on an item out of viewport. We keep the last focused rendered even if blurred for the scenario of tabbing in and and out of the VirtualizedList. Validated via UT.
Configuration menu - View commit details
-
Copy full SHA for 8a9c4e2 - Browse repository at this point
Copy the full SHA 8a9c4e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 32e73ee - Browse repository at this point
Copy the full SHA 32e73eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a5503e - Browse repository at this point
Copy the full SHA 2a5503eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f0de65b - Browse repository at this point
Copy the full SHA f0de65bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 03f180f - Browse repository at this point
Copy the full SHA 03f180fView commit details -
Configuration menu - View commit details
-
Copy full SHA for eb64202 - Browse repository at this point
Copy the full SHA eb64202View commit details -
Configuration menu - View commit details
-
Copy full SHA for 75cc358 - Browse repository at this point
Copy the full SHA 75cc358View commit details -
Configuration menu - View commit details
-
Copy full SHA for 093968e - Browse repository at this point
Copy the full SHA 093968eView commit details
Commits on Jul 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7c23f47 - Browse repository at this point
Copy the full SHA 7c23f47View commit details -
Configuration menu - View commit details
-
Copy full SHA for d739bc3 - Browse repository at this point
Copy the full SHA d739bc3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 65517fe - Browse repository at this point
Copy the full SHA 65517feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8437121 - Browse repository at this point
Copy the full SHA 8437121View commit details
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.