Fixes Focus and FocusScope's assignment of canRequestFocus.#46168
Fixes Focus and FocusScope's assignment of canRequestFocus.#46168gspencergoog merged 3 commits intoflutter:masterfrom
Conversation
58b25da to
9d33d15
Compare
9d33d15 to
5497eca
Compare
| expect(key.currentState.focusNode.canRequestFocus, isFalse); | ||
| }); | ||
|
|
||
| testWidgets('canRequestFocus causes descendants of scope to be skipped.', (WidgetTester tester) async { |
There was a problem hiding this comment.
Should there also be a new test for skipTraversal since that logic also changes in this PR?
There was a problem hiding this comment.
Added a test. I don't actually need to change the code for skipTraversal: it's getter doesn't depend on the enclosing scope, so the code change doesn't change the logic.
It doesn't hurt to have another test though, and I figured that changing the code to match what I did for canRequestFocus made it more future proof (and didn't actually change anything).
|
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Description
This fixes an issue where lines like this:
Were causing the
canRequestFocusbit to copy the status of the enclosing scope, sincecanRequestFocusalso looks to the enclosing scope to decide if it can focus.Related Issues
Tests
canRequestFocusdoes the right thing for child nodes.