question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nextFocus API on tvOS using UIFocusGuide not constantly working

See original GitHub issue

Description

First of all, I want to thank you with the new implementation of nextFocus on tvOS with UIFocusGuide. It is really great and makes it usable in nearly every cases compared to previous implem.

However there is some cases where it is not working as expected:

  • When the Touchable (TouchableOpacity in my case) is moving because it is a child of an animated view that is translating. I have the feeling the UIFocusGuide you put on each side of touchable is not impacted by the animations or layout changes. I don’t know how it can be resolved, but when there is some complex UI with animations of multiple stack of buttons, it would be great if animations was not impacting nextFocus.

  • In a ScrollView. It is working when you want to nextFocus on the “exterior” sides of an item like for example, when it is a vertical list, going from the item to nextFocusLeft or nextFocusRight is working, but if you want to put for example a nextFocusDown on the first item, it is not considered and just focus the next item of the list.

I hope my explanation is clear, and i thank you again for this great repo !

Version

0.68.2-3

Output of npx react-native info

System: OS: macOS 12.3 CPU: (6) x64 Intel® Core™ i5-8500B CPU @ 3.00GHz Memory: 33.38 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.3.0 - /usr/local/bin/node Yarn: Not Found npm: 8.5.1 - /usr/local/bin/npm Watchman: 2021.06.07.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/etiennelabrot/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 13.3/13E113 - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: ^17.0.2 => 17.0.2 react-native: Not Found react-native-macos: Not Found react-native-tvos: 0.68.2-3 npmGlobalPackages: react-native: Not Found

Steps to reproduce

Specific cases were described in the description.

If need more information about how to reproduce issues, tell me.

Snack, code example, screenshot, or link to a repository

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
douglowdercommented, Jul 26, 2022

Thanks for this very detailed explanation. I thought that the layout constraints on the focus guides would prevent these from happening… I’ll look into this 👍

0reactions
douglowdercommented, Sep 24, 2022

@etiennelab it would be helpful if you can provide a simple example (either the ScrollView or animated view) that shows the issue you are trying to solve.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · react-native-tvos/react-native-tvos - GitHub
React Native repo with additions for Apple TV and Android TV support. ... nextFocus API on tvOS using UIFocusGuide not constantly working backlog...
Read more >
Understanding and Visualizing UIFocusGuide on tvOS
Working with tvOS can be tedious if the focus engine cannot infer the user interface layout. Let's see how UIFocusGuide can help us....
Read more >
tvOS Focus Engine | Brightec
Focus Guides​​ In the example above the user is swiping down on the Siri remote but there are no views within the focus...
Read more >
TV OS UIFocusEnvironment Not focusing Button - ios
For this you can place a UIFocusGuide to the left of button 3. (https://developer.apple.com/documentation/uikit/uifocusguide).
Read more >
UIFocusGuide - Documentation - Apple Developer
As a subclass of UILayoutGuide , a focus guide is not a view and does not define a new view or participate in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found