flexn-io / create

Build apps for web, TVs, desktops, consoles, wearables and more. Developer friendly UI library targeting all form factors platforms. Another notable feature is providing focus management for TVs which very easy to implement using Create.
https://create.flexn.org
MIT License
26 stars 6 forks source link

Apple TV remote control swipes not working in list and rows (recycler) #64

Closed hlz closed 1 year ago

hlz commented 1 year ago

Hi, we're currently having issues with swipes not being recognised on Apple TV. When loading the default example Flexn app straight on an Apple TV and navigating to the carousels page one can't swipe left and right in the rows. When using a bluetooth keyboard it works fine with left and right keys. Also, the simulator works fine with left and right keys.

We've tracked down the issue being related to the direction-checking code in sdk/lib/focusManager/model/row.js with checks on left, right and swipeLeft and swipeRight need to be changed to DIRECTION_xxx constants.

But that only partially solves our problem. When swiping right in a row and then swipe down the focusManager keeps on swiping right. We haven't been able to pin down the issue so it would be nice if some of the authors could take a look at. It is definitely a breaking issue on Apple TV when using a real remote.

RobertArissen commented 1 year ago

I also took a look at this problem. It seems that if you go a certain direction very often it remembers it a few times no matter which way you go. This only happens in the recycler, you won't notice this on a normal screen without recycler (i logged handleKeyEvent in keyHandler.ts)

RobertArissen commented 1 year ago

I think I found a solution to this problem. Just not sure if this is the right solution (adjustments in TvRemoteHandler.swift). But in the demo application it seems to work fine now.

fork: https://github.com/RobertArissen/flexn

aurimasmi commented 1 year ago

Seems like a valid issue, will take a look now

RobertArissen commented 1 year ago

Any update on this issue?

hlz commented 1 year ago

Any update on this issue?

I'm curious too :)

aurimasmi commented 1 year ago

@RobertArissen @hlz sorry for very late feedback. Library was refactored very heavily a lot of issues were fixed including this one. Also latest version has support for React Native

GabrieleKaceviciute commented 1 year ago

Closing as answer has been provided, feel free to reopen if needed