mirror of
https://github.com/flutter/flutter
synced 2024-08-24 18:36:03 +00:00
Implement _suspendedNode
fix (#143556)
Previously we merged #142930, to solve issue #87061.
Since then, I discovered that the keyboard input wasn't being captured after the app had been paused and resumed. After some digging, I realized that the problem was due to [a line in editable_text.dart](d4b1b6e744/packages/flutter/lib/src/widgets/editable_text.dart (L3589)
) that called the `focusNode.consumeKeyboardToken()` method.
Luckily, it's a very easy fix: we just use `requestFocus()` instead of `applyFocusChangesIfNeeded()`. @gspencergoog could you take a look when you have a chance?
This commit is contained in:
parent
6707f5efbe
commit
fc07b241ae
|
@ -1711,10 +1711,9 @@ class FocusManager with DiagnosticableTreeMixin, ChangeNotifier {
|
|||
_suspendedNode = null;
|
||||
}
|
||||
else if (_suspendedNode != null) {
|
||||
assert(_focusDebug(() => 'marking node $_suspendedNode to be focused'));
|
||||
_markedForFocus = _suspendedNode;
|
||||
assert(_focusDebug(() => 'requesting focus for $_suspendedNode'));
|
||||
_suspendedNode!.requestFocus();
|
||||
_suspendedNode = null;
|
||||
applyFocusChangesIfNeeded();
|
||||
}
|
||||
} else if (_primaryFocus != rootScope) {
|
||||
assert(_focusDebug(() => 'suspending $_primaryFocus'));
|
||||
|
|
Loading…
Reference in a new issue