react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

ScrollView not work as expected on Xbox console, buttons aren't interactable

Open l3tang opened this issue 7 years ago • 5 comments

Environment

  1. react-native -v: returned error
  2. npm ls rnpm-plugin-windows: [email protected]
  3. npm ls react-native-windows: [email protected]
  4. node -v: v11.4.0
  5. npm -v: 6.4.1

Then, specify:

  • Target Platform Version(s): 10.0.18362

  • Target Device(s): Xbox One

  • Visual Studio Version: 2017

  • Build Configuration: Debug, Release

Steps to Reproduce

We're building an Xbox app and the content will need to be scrolled. Our HOCs have buttons and other interactable elements inside, along with text and images/videos. When our component is not inside ScrollView, we're able to interact with the elements as expected (top down) using the Xbox controller. As soon as we put ScrollView around it, we lose interaction with the elements. We can scroll the page but can't do anything else. In testing it, I tried putting a plain button as a direct child of the ScrollView, after my HOC. This then gives me access to the buttons in my HOCs but the interaction becomes bottom up instead of top down. I also tested it that if I put a text element below that, then I once again can't interact with the any of the buttons, even the one that was a direct child of the ScrollView.

Expected Behavior

We interact with elements on the screen and as we keep pressing the down button, the focus goes to the next focusable element. Or if there are no more focusable elements, it would scroll the page.

Actual Behavior

We're scrolling the page and then once you reach the bottom, and if the last direct child of ScrollView is an interactable element, we can interact with all the interactable elements, bottom up. If the last direct child of ScrollView is not an interactable element, nothing is interactable.

l3tang avatar Aug 15 '19 20:08 l3tang

More additional info: If the view doesn't actually need scrolling, even direct children buttons are not interactable no matter what I do.

l3tang avatar Aug 15 '19 20:08 l3tang

More info: I got it to work if I removed the background image component that we had and removed the height property on the content. That made things interactable, but still, the page scrolls to the bottom first and then goes through the interactable elements.

If the first and last rendered elements in the list are non-interactable items, the you can't interact with anything in the list. If the first element in the list in interactable, then the interaction would be top down. If last element is interactable, then the interaction is bottom up. If both the first and last elements are interactable, then it's still bottom up.

The desired behavior is still that we want it to go through the interactable elements first instead of scroll first so that it's always a top-down interaction. If we've reached the last interactable element and there's still content below, then scroll.

l3tang avatar Aug 16 '19 21:08 l3tang

@StephenLPeters Hey, @kmelmon has been looking into this one but may need some help unraveling the scrolling bits. Can you help?

chrisglein avatar Aug 26 '19 18:08 chrisglein

Setting IsTabStop = false on the custom ContentControl child of ScrollViewer helps, but doesn't fix all cases. Handing this over to @stecrain who's going to try things out further.

kmelmon avatar Aug 30 '19 00:08 kmelmon

Closing. L3tang confirmed the tab stop change fixes the current issues

stecrain avatar Sep 05 '19 02:09 stecrain