Skip to content

[CP] Refactor route focus node creation #149178

Closed

Description

@techouse

Issue Link

#148867

Target

stable

PR Link

#149378

Changelog Description

Refactor route focus node creation

Impacted Users

iOS users on Flutter stable 3.22.0 and 3.22.1

Impact Description

Unable to focus on TextField or open the keyboard again after side pop from another screen on iOS.

Workaround

Stay on 3.19.6 or use tags 3.22.0-19.0.pre and above

Risk

low

Test Coverage

yes

Validation Steps

  • Flutter stable 3.22.0, 3.22.1; tag 3.22.0-18.0.pre and below

    • run an app with a TextField on iOS
    • tap into TextField
    • keyboard opens
    • navigate to a separate screen
    • swipe back (this is important)
    • tap into TextField
    • keyboard does not open
  • Flutter tag 3.22.0-19.0.pre and above

    • run an app with a TextField on iOS
    • tap into TextField
    • keyboard opens
    • navigate to a separate screen
    • swipe back (this is important)
    • tap into TextField
    • keyboard opens

Activity

  1. techouse commented on May 28, 2024

    @techouse
    ContributorAuthor

    I tested these versions

    Version Works Comment
    3.22.0-0.45.0.pre ✅
    3.22.1 ❌
    3.22.0-0.44.0.pre ✅
    3.22.0-0.43.0.pre ✅
    3.22.0-0.30.0.pre ✅
    3.22.0 ❌
    3.22.0-0.29.0.pre ✅
    3.22.0-0.20.0.pre ✅
    3.22.0-0.19.0.pre ✅ fixed here
    3.22.0-0.18.0.pre ❌
    3.22.0-0.17.0.pre ❌
  2. jmagman commented on May 28, 2024

    @jmagman
    Member

    @justinmc @chunhtai I'm not sure if this is the right thing to cherry-pick, or instead it should be to fix forward to #147607. Could you take a look at the regression and test it out?

  3. justinmc commented on May 29, 2024

    @justinmc
    Contributor

    It looks like the actual PR that we would cherry pick is #147607, is that right @chunhtai? Also, are we sure that that is what fixes #148573 (and/or #148867) @techouse?

  4. chunhtai commented on May 29, 2024

    @chunhtai
    Contributor

    It looks like the actual PR that we would cherry pick is #147607

    I think in order to cherry pick the reapply, you will need to cherry pick the revert first right?

    it seems like the release only contains the problematic popscope commit but not the revert and reland? if so we can either cherry pick the revert or both the revert and reland, I am fine with either one.

  5. chunhtai commented on May 29, 2024

    @chunhtai
    Contributor

    actually it may be better to cherry pick both because the breaking change is already out with the problematic popscope commit, we don't want them to do it twice

  6. jmagman commented on May 29, 2024

    @jmagman
    Member

    @chunhtai could you prep that cherry-pick then since it's relatively complicated, assuming @justinmc would approve it as worth a hotfix.

  7. techouse commented on May 29, 2024

    @techouse
    ContributorAuthor

    Also, are we sure that that is what fixes #148573 (and/or #148867) @techouse?

    As stated above in #149178 (comment), I tested with 11 different versions, including one before and one after the fix.

    If required, I can do some additional testing, but it seems more than likely that this is the fix/cause.

    I do agree with @jmagman that it's a spicy one. 🙈

  8. chunhtai commented on May 29, 2024

    @chunhtai
    Contributor

    I am new to the process, may I know which branch I should create the cherry pick against?

  9. chunhtai commented on May 29, 2024

    @chunhtai
    Contributor

    actually this looks weird, the stable doesn't have the popscope change, something else is at play.

  10. chunhtai commented on May 29, 2024

    @chunhtai
    Contributor

    This should be the commit that fixes the issue
    #147390

    can you verify? if it indeed is, we should change the this issue title and description

    cc @gspencergoog

  11. techouse commented on May 29, 2024

    @techouse
    ContributorAuthor

    This should be the commit that fixes the issue #147390

    can you verify? if it indeed is, we should change the this issue title and description

    cc @gspencergoog

    @chunhtai You're right! It does look like #147390 is the real fix. I somehow I compared it in reverse, 3.22.0-19.0.pre...3.22.0-18.0.pre instead of 3.22.0-18.0.pre...3.22.0-19.0.pre 🤦 and the sheer quantity of PopScopes got me.

  12. changed the title [-][CP] Revert "add a new PopScope.onPopWithResultInvoke widget to replace PopScope.onPopInvoke"[/-] [+][CP] Refactor route focus node creation[/+] on May 29, 2024
  13. chunhtai commented on May 29, 2024

    @chunhtai
    Contributor

    I think this issue is bad enough that should deserve a cp. @gspencergoog Do you think this is a low risk cp?

  14. gspencergoog commented on May 29, 2024

    @gspencergoog
    Contributor

    Yes, I consider this low risk. The ListenableBuilder part doesn't change functionality at all, and the withExternalFocusNode part is the bug fix, and has very similar functionality to the original code, but will not overwrite the skipTraversal and other attributes of the node when they are out of sync with the Focus widget. The effect of the change should be local to this widget and its FocusScopeNode.

  15. JosephNK commented on May 31, 2024

    @JosephNK

    This issue seems to require a hotfix. It is a big problem that text fields do not work properly in released apps.

  16. lukemmtt commented on Jun 6, 2024

    @lukemmtt
    Contributor

    This PR should be closed, as the fix was successfully merged and released as a hotfix release as Flutter 3.22.2:

    Thank you @techouse and all others who helped troubleshoot and fix this! 🚀

  17. github-actions commented on Jun 21, 2024

    @github-actions

    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.

  18. locked as resolved and limited conversation to collaborators on Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cp: reviewCherry-picks in the review queue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions