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

TVEventHandler does not capture any events #21896

Closed
acollazomayer opened this issue Oct 22, 2018 · 3 comments
Closed

TVEventHandler does not capture any events #21896

acollazomayer opened this issue Oct 22, 2018 · 3 comments
Labels
Bug Platform: tvOS tvOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@acollazomayer
Copy link

Environment

React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
Memory: 2.49 GB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.5.0 - ~/.nvm/versions/node/v10.5.0/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.5.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
Android SDK:
Build Tools: 23.0.1, 25.0.0, 25.0.1, 26.0.1, 26.0.2, 27.0.0, 27.0.3, 28.0.1
API Levels: 23, 24, 25, 26, 27, 28
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
react-native: 0.57.3 => 0.57.3
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-create-library: 3.1.2
react-native-drm-video: 3.1.0
react-native-git-upgrade: 0.2.7
react-native-rename: 2.2.2

Description

I implement the code from the documentation about TVEventHandlers and i do not receive any events when i press the buttons controls. The adb logcat throws that the events are reaching however the TVHandler does not capture them.

Reproducible Demo

I dont use expo however just add this code to the react-native init. And you will see my point.

    super();

    this._tvEventHandler = null;
  }

  _enableTVEventHandler() {
    this._tvEventHandler = new TVEventHandler();
    console.log(this._tvEventHandler)
    this._tvEventHandler.enable(this, function(cmp, evt) {
      console.log(evt)
   });
  }

  _disableTVEventHandler() {
    if (this._tvEventHandler) {
      this._tvEventHandler.disable();
      delete this._tvEventHandler;
    }
  }

  componentDidMount() {
    this._enableTVEventHandler();
  }

  componentWillUnmount() {
    this._disableTVEventHandler();
  }```
@havlasme
Copy link
Contributor

havlasme commented Oct 24, 2018

I've encountered the same problem, but the handler will work if I put any touchable component on the screen.

Also I've just found out that it also works if I put hasTVPreferredFocus={true} on wrapping View.

@stale
Copy link

stale bot commented Aug 2, 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 a "Discussion" or add it to the "Backlog" 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 Aug 2, 2019
@stale
Copy link

stale bot commented Aug 9, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 9, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: tvOS tvOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants