Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateChildren() needs to walk the list forward #182

Closed
FlutterIssues opened this issue Nov 9, 2015 · 2 comments · Fixed by #1400
Closed

updateChildren() needs to walk the list forward #182

FlutterIssues opened this issue Nov 9, 2015 · 2 comments · Fixed by #1400
Assignees
Labels
a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.

Comments

@FlutterIssues
Copy link

Issue by Hixie
Monday Oct 05, 2015 at 21:59 GMT
Originally opened as https://github.com/flutter/engine/issues/1495


When you have a block with multiple focusable controls, the first one needs to get the focus. This means the first one needs to be the first to be built, so it's the first that calls build() and thus the first that calls Focus.at(). However, right now updateChildren() walks the list backwards which means the last child gets the focus.

We probably want to separate the creation of the Element nodes and the setting of the slots from the actual building of the children, somehow, so we can still walk the list backwards to create the slots but walk it forwards to build.

@FlutterIssues FlutterIssues added this to the Blue Sky milestone Nov 9, 2015
@FlutterIssues FlutterIssues added bug framework flutter/packages/flutter repository. See also f: labels. labels Nov 9, 2015
@Hixie
Copy link
Contributor

Hixie commented Dec 16, 2015

Another side-effect of this is that if you have a list of images, we load the images bottom-first. That's weird-looking.

@abarth abarth added the a: text input Entering text in a text field or keyboard related problems label Jan 22, 2016
@abarth abarth self-assigned this Jan 26, 2016
abarth added a commit to abarth/flutter that referenced this issue Jan 27, 2016
This patch changes the framework to walk the child list forwards so that build
functions with global side effects do sensible things. Specifically, if you
have a number of autofocusable children, the first one the list will acquire
the focus because it gets built first now.

Fixes flutter#182
@efidje efidje mentioned this issue May 8, 2018
@github-actions
Copy link

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants