bamlab / react-tv-space-navigation

A React Native module to handle spatial navigation for a TV application in a 100% cross-platform way
https://bamlab.github.io/react-tv-space-navigation/
MIT License
178 stars 15 forks source link

Modal focus losing #137

Open yusufusta opened 3 weeks ago

yusufusta commented 3 weeks ago

Describe the bug The focus of the buttons in the modal disappears after a few seconds and the focus is on the first element.

To Reproduce Same code as example

Screenshots

https://github.com/bamlab/react-tv-space-navigation/assets/46392667/4288235d-0d0d-4a2a-a936-49e93c976882

Version and OS

yusufusta commented 3 weeks ago

This is what happens when the state changes behind the modal while it is open. I fixed this but I think there is a problem.

pierpo commented 3 weeks ago

Hey! Thank you for the video. I didn't really understand the problem though 😂 What did you do during the video? You have your focus, you go right-right... then the focus is lost and comes back to first element? Why? Did something happen? Another input?

Can you share a piece of code, and how you solved it?

Thanks!

yusufusta commented 2 weeks ago

Yes, you are right @pierpo 😅.

Let me explain: A modal opens, and I move the focus to another element by going to the right. However, when states change in the background, the focus returns to the default focus. In other words, the focus goes back to the beginning.