Fix focus bug that was breaking nested navigators
Turns out we were assuming that once the global key is gone, our listener is unregistered. It isn't. I'm planning on adding a test as part of my nested navigator work.
This commit is contained in:
@@ -192,6 +192,7 @@ class FocusState extends State<Focus> {
|
||||
|
||||
void _scopeRemoved(GlobalKey key) {
|
||||
assert(_focusedScope == key);
|
||||
GlobalKey.unregisterRemoveListener(_currentlyRegisteredScopeRemovalListenerKey, _scopeRemoved);
|
||||
_currentlyRegisteredScopeRemovalListenerKey = null;
|
||||
setState(() {
|
||||
_focusedScope = null;
|
||||
|
||||
Reference in New Issue
Block a user