-
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
Fix focus engine issue with list views on Apple TV #12944
Conversation
Thank you so much for pointing this out! I hope I will fix this soon. |
@shergin if you would prefer a native fix, I can have a look. I also realized that we probably need to make some doc changes so users know that |
@dlowder-salesforce I will appreciate any help in researching this area, therefore:
|
@shergin yes it would be great if we could still do the clipping and not have this issue. Maybe there's some heuristic we can put in where we don't clip subviews that are near the edge of the viewable area, so that the bottom visible subview is not the bottommost view in the hierarchy, and this focus engine scrolling problem won't be triggered. |
@shergin I tested out an idea where we create a buffer zone around the visible area of the view, and don't remove subviews that touch that zone. Setting it to 500 px seems to work well for the modified ListViewGridLayoutExample I've been testing with. See the most recent commit in https://github.com/dlowder-salesforce/react-native/tree/tvos-listview-native-fix . It seems to me that this might also resolve the related VoiceOver issue you mentioned, but I haven't tested that yet. |
Yeah, I also thought about that. Probably increasing |
@shergin It's not clear to me what else we could do, other than increasing |
@shergin it does not appear to me that increasing |
@shergin I did some more testing of my native fix. It seems to work well as long as one doesn't navigate down the scrollview too fast. However, if you use the TV remote or arrow keys to go too fast, it seems like the code to add and remove and render subviews is having trouble keeping up, and occasionally the focus engine will get confused and pop the focus back up to the top. With removeClippedSubviews disabled, I don't seem to see any of those problems. Based on what I'm seeing right now, I believe that disabling removeClippedSubviews is the right solution for Apple TV. |
@dlowder-salesforce Oh, that's interesting and super important observation! Thank you!!1 But, again, right now, it is just a feeling, no real proof. Give me some time. |
Ok sounds good... since there is a workaround for the issue on Apple TV, I'll close this and wait for you to complete your work. |
Motivation: Fix issue where Apple TV focus engine overscrolls when a list or scroll view is set to remove clipped subviews. See #12793 .
Test plan: Manual testing using modified source for UIExplorer's ListViewGridLayoutExample.