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

Focus Loss while updating list doing pagination #72

Open
Durgesh-1992 opened this issue Oct 15, 2024 · 4 comments
Open

Focus Loss while updating list doing pagination #72

Durgesh-1992 opened this issue Oct 15, 2024 · 4 comments

Comments

@Durgesh-1992
Copy link

Thanks for having patience with my query and helping me out. I have another query,When we do horizontal scroll and load future or past data then focus loss is seen. I checked on which view component using logging activity.currentFocus it focus is on program grid item but it doenst take any dpad event. the only recovery to this focus lost is focus on otherview component like filter. Can you pls guide me where to look in the code for this issue or what can be the reason for this.

@dzolnai
Copy link
Member

dzolnai commented Oct 15, 2024

Hello, this part of the code might be your issue:

// We will temporarily catch the focus, so that the program guide does not focus on all the views while it is scrolling.

The problem is, when loading data, the grid should never be in focus, because it could lead to weird jumping and incorrect scroll status. I think what you need to do, is put the focus back on the grid once the data is loaded, probably on the item focused before?

@Durgesh-1992
Copy link
Author

onChildDetachedFromWindow is getting called I checked in the logs which remove the currently focused child element and again when focus appear it appears on other child not on previous focused child.

@dzolnai
Copy link
Member

dzolnai commented Oct 15, 2024

You could try to remember the previously focused child, and calling focus on it manually when the loading is done?

@Durgesh-1992
Copy link
Author

yeah I have already added that code to request focus but sometime it doesn't works. Also in my case if there are multiple set of pagination data is getting loaded for past days then this issue is frequent but it rarely happens when data is getting loaded for future day or date time after current viewport time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants