Unverified Commit fc07b241 authored by Nate's avatar Nate Committed by GitHub

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](https://github.com/flutter/flutter/blob/d4b1b6e744ba6196e14fb49904f07a4aea4d5869/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?
parent 6707f5ef
......@@ -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'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment