Skip to content
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

[Android TV] Multiple Scrollviews of Touchable strange D-Pad navigation pattern #20593

Closed
3 tasks done
aamalric opened this issue Aug 9, 2018 · 3 comments
Closed
3 tasks done
Labels
Bug Platform: Android Android applications. Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.

Comments

@aamalric
Copy link
Contributor

aamalric commented Aug 9, 2018

Environment

React Native Environment Info:
System:
OS: Linux 4.15 Ubuntu 16.04.5 LTS (Xenial Xerus)
CPU: x64 Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
Memory: 609.16 MB / 15.32 GB
Shell: 4.3.48 - /bin/bash
Binaries:
Node: 8.11.3 - /usr/bin/node
npm: 5.6.0 - /usr/bin/npm
SDKs:
Android SDK:
Build Tools: 23.0.1, 26.0.1, 26.0.3, 27.0.3
API Levels: 23, 26, 27
npmPackages:
react: 16.4.1 => 16.4.1
react-native: 0.56.0 => 0.56.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1

Description

See original closed ticket from @Weetbix here: #20100
Reproduced the issue on latest react version.

When having more than one scrollList of touchables, D-Pad navigation pattern is wrong using left-right keys to scroll horizontally. When reaching the end of the first list, the next touchable receiving focus is one from the second list. Same goes when reaching the start of the second list, next focused touchable is one from the above list.

Expected behavior : only reach touchables into the same horizontal scroll list when using left-right and goes to next list touchables only when using up/down keys.

Reproducible Demo

import React, {Component} from 'react';
import {View, Text, TouchableOpacity, ScrollView} from 'react-native';`

type Props = {};
export default class App extends Component<Props> {
  render() {
  const data = [];
  for (let i = 0; i < 10; i++)
    data.push(i);

  return (
    <View>
      {[1, 2].map((index) => (
        <ScrollView key={index} horizontal style={{height: 210}}>
          {data.map(i => (
            <TouchableOpacity key={i}>
              <View
                style={{
                  backgroundColor: 'grey',
                  width: 200,
                  height: 200,
                }}
              >
                <Text style={{fontSize: 60}}>{i}</Text>
              </View>
            </TouchableOpacity>
          ))}
        </ScrollView>
      ))}
    </View>
  );
  }
}

@react-native-bot react-native-bot added Platform: Android Android applications. Platform: Linux Building on Linux. labels Aug 9, 2018
@gregaou
Copy link
Contributor

gregaou commented Oct 17, 2018

I reproduce the same issue on RN 0.57. I'm also interessted for a fix or for any informations on how that can be investigated.

@stale
Copy link

stale bot commented Jan 16, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 16, 2019
@aamalric
Copy link
Contributor Author

It does still require community's attention. Please don't close it.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 16, 2019
@hramos hramos removed the Bug Report label Feb 6, 2019
mbardauskas pushed a commit to mbardauskas/react-native that referenced this issue Feb 21, 2019
Summary:
Add properties to be able to set the nextFocus. It can be very useful with Android TV.

New android View properties :

* nextFocusDown binded to [setNextFocusDownId](https://developer.android.com/reference/android/view/View.html#setNextFocusDownId(int))
* nextFocusForward binded to [setNextFocusForwardId](https://developer.android.com/reference/android/view/View.html#setNextFocusForwardId(int))
* nextFocusLeft binded to [setNextFocusLeftId](https://developer.android.com/reference/android/view/View.html#setNextFocusLeftId(int))
* nextFocusRight binded to [setNextFocusRightId](https://developer.android.com/reference/android/view/View.html#setNextFocusRightId(int))
* nextFocusUp binded to [setNextFocusUpId](https://developer.android.com/reference/android/view/View.html#setNextFocusUpId(int))

Can be used to fix :

* Fixes facebook#20593
* Fixes facebook#20100

Same PR as facebook#22080 but accorded to changes on master
Pull Request resolved: facebook#22082

Differential Revision: D14162740

Pulled By: cpojer

fbshipit-source-id: 9a13a185d4e8307ce67014fb076c62d135c487c3
@facebook facebook locked as resolved and limited conversation to collaborators Feb 21, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants