-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
The FocusScopeNode serves two main purposes:
- It "scopes" the focus so that you can't escape the scope by tab traversal.
- It keeps a stack of previously focused widgets so that if you return focus to the scope, it will re-focus the widget that previously had focus inside of the scope.
The two jobs are pretty orthogonal to each other, and rather than give it even more "modes", it makes sense to split it into two things.
The FocusTraversalGroup is the proper place for a flag that would limit the tab traversal to within the group (the actual flag would be on FocusNode), and it would make sense to deprecate the remaining FocusScopeNode (and associated FocusScope widget) and replace it with something that just did the focus history piece (probably called FocusHistory for obvious reasons).
This would give us a chance to separate these concerns, and would let us simplify a lot of the weird knots that the focus API is wound into as a result of wanting to keep from breaking previous APIs.
cc @goderbauer