Reputation: 141
In my app I have a UICollectionView
with a custom layout representing a grid of arbitrary-sized items and a custom scrolling behavior implemented by overriding targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint)
.
After updating to tvOS 18 I've noticed the following change in focus behavior: When focus is on an item which is only partially visible (e.g. right edge is outside of the visible area), and swiping right in order to move focus to the next cell further to the right - nothing happens.
The delegate method collectionView(_ collectionView: UICollectionView, canFocusItemAt indexPath: IndexPath)
is called several times on swiping, but the indexPath of a desired item is not even among the candidates, despite that it certainly exists in the collection view and is located right next to the current one, I've made sure about that.
In tvOS 17 and older the focus was moving without issues under such scenario.
Did anyone face the same issue and/or has suggestions on any possible fix simpler than completely changing the scrolling behavior to avoid focused items staying partially visible?
Upvotes: 0
Views: 176