Skip to content

Anti-hysteresis code causes loss of focus occasionally. #33435

Closed

Description

@gspencergoog

Reported by @eyun-tv (thank you for the report and the clear reproduction case!):

"I write a demo use DefaultFocusTraversal with ReadingOrderTraversalPolicy
But , I find when you press up or down , sometimes , the focus will lose .
I record a video https://vimeo.com/338635739 for show this bug

My code is there :
https://github.com/eyun-tv/flutter-tv/blob/master/lib/main.dart
https://github.com/eyun-tv/flutter-tv/blob/master/lib/ui/util/video.dart

My flutter version is master and my tv box is android 9"

I took a quick look, and it seems to be related to the anti-hysteresis code that makes sure we follow the same reverse path as we took forward, probably having to do with reaching the end of the history but not doing anything in that case.

Activity

  1. self-assigned this
    on May 28, 2019
  2. urwork commented on Jun 6, 2019

    @urwork

    I have the same problem.

    I print all nearestScope children in focus scope _handleKeyPress

    
            int n = 0;
            node.nearestScope.children.forEach((i) {
              print("> $i ${++n}");
            });
    

    I found the FocusNode number is less than list view items .

    I think maybe because the list view just keep the visible items , but remove the hide items .

    How to fix this ? Maybe need a FocusListView ?

  3. eyun-tv commented on Jun 10, 2019

    @eyun-tv

    Is there any schedule for fix this ?
    Can I just simple disable history or clear history ? How to do this ?

  4. github-actions commented on Aug 29, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions