Skip to content

Commit fc07b24

Browse files
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?
1 parent 6707f5e commit fc07b24

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/flutter/lib/src/widgets/focus_manager.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,10 +1711,9 @@ class FocusManager with DiagnosticableTreeMixin, ChangeNotifier {
17111711
_suspendedNode = null;
17121712
}
17131713
else if (_suspendedNode != null) {
1714-
assert(_focusDebug(() => 'marking node $_suspendedNode to be focused'));
1715-
_markedForFocus = _suspendedNode;
1714+
assert(_focusDebug(() => 'requesting focus for $_suspendedNode'));
1715+
_suspendedNode!.requestFocus();
17161716
_suspendedNode = null;
1717-
applyFocusChangesIfNeeded();
17181717
}
17191718
} else if (_primaryFocus != rootScope) {
17201719
assert(_focusDebug(() => 'suspending $_primaryFocus'));

0 commit comments

Comments
 (0)