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
Fix: break out of all loops on first focus #11827
base: master
Are you sure you want to change the base?
Fix: break out of all loops on first focus #11827
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
1242d57
to
08913e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure the fix here, i thought the existing logic to break early as well
The existing logic does break early out of the first loop but it is not breaking out of the recursion. The last test case added in this PR tests the fixed issue which I'll try to illustrate. Before:
Result: focus is called twice and focused on 'phone'. After:
Result: focus is called once and focused on 'last'. |
I have a form structure like so, where I have a group depth of more than 2.
What was happening is when
iterateFieldsByAction
calls itself recursively it did call focus onpersonal.name.first
but then it breaks out ofpersonal.name
and continues looping and calling focus onpersonal.phone-number
.This change will break out of the current loop and recursively break out of all loops.