-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: focusFocus traversal, gaining or losing focusFocus traversal, gaining or losing focusfound in release: 3.13Found to occur in 3.13Found to occur in 3.13found in release: 3.16Found to occur in 3.16Found to occur in 3.16frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
The following test case was broken by #130812
testWidgets("Requesting nextFocus on node focuses its descendant", (WidgetTester tester) async {
for (bool canRequestFocus in <bool>{true, false}) {
final FocusNode node1 = FocusNode();
final FocusNode node2 = FocusNode();
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: FocusTraversalGroup(
policy: ReadingOrderTraversalPolicy(),
child: FocusScope(
child: Focus(
focusNode: node1,
canRequestFocus: canRequestFocus,
child: Focus(
focusNode: node2,
child: Container(),
),
),
),
),
),
);
final bool didFindNode = node1.nextFocus();
await tester.pump();
expect(didFindNode, isTrue);
expect(node1.hasPrimaryFocus, isFalse);
expect(node2.hasPrimaryFocus, isTrue);
}
});Before this change, callers could call FocusNode.nextFocus() to focus a descendant node. #130812 caused a regression whereby this no longer works.
We should check in this test and get it passing again :-)
Marking as P1 because it's a regression, but feel free to drop down to P2 if I'm misreading this.
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: focusFocus traversal, gaining or losing focusFocus traversal, gaining or losing focusfound in release: 3.13Found to occur in 3.13Found to occur in 3.13found in release: 3.16Found to occur in 3.16Found to occur in 3.16frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.