)]}'
{
  "commit": "1712c83ea7d3a3fa28ae44645e708b0dc7626b8b",
  "tree": "535d673a4b490c1de186d61d004d106814cfffce",
  "parents": [
    "7e99fcfbeb9b3347881e20f658144c0a205738ec"
  ],
  "author": {
    "name": "Koji Wakamiya",
    "email": "koji.wakamiya@gmail.com",
    "time": "Thu Mar 12 09:30:16 2026 +0900"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Mar 12 00:30:16 2026 +0000"
  },
  "message": "[ios][engine] Fix keyboard flicker when switching text fields (#182661)\n\nfix https://github.com/flutter/flutter/issues/180842\n\nThe issue was caused by https://github.com/flutter/flutter/pull/173598.\n\nWhen there is a single TextField, the MethodChannel calls are as\nfollows:\n\n```\nhandleMethodCall: TextInput.setClient\nhandleMethodCall: TextInput.setEditableSizeAndTransform\nhandleMethodCall: TextInput.setMarkedTextRect\nhandleMethodCall: TextInput.setCaretRect\nhandleMethodCall: TextInput.setStyle\nhandleMethodCall: TextInput.setEditingState\nhandleMethodCall: TextInput.show\nhandleMethodCall: TextInput.requestAutofill\nhandleMethodCall: TextInput.clearClient\nhandleMethodCall: TextInput.hide\n```\n\nHowever, when there are two TextFields, the calls become:\n\n\n```\nhandleMethodCall: TextInput.setClient\nhandleMethodCall: TextInput.setEditableSizeAndTransform\nhandleMethodCall: TextInput.setMarkedTextRect\nhandleMethodCall: TextInput.setCaretRect\nhandleMethodCall: TextInput.setStyle\nhandleMethodCall: TextInput.setEditingState\nhandleMethodCall: TextInput.show\nhandleMethodCall: TextInput.requestAutofill\nhandleMethodCall: TextInput.clearClient\nhandleMethodCall: TextInput.setClient\nhandleMethodCall: TextInput.setEditableSizeAndTransform\nhandleMethodCall: TextInput.setMarkedTextRect\nhandleMethodCall: TextInput.setCaretRect\nhandleMethodCall: TextInput.setStyle\nhandleMethodCall: TextInput.setEditingState\nhandleMethodCall: TextInput.show\nhandleMethodCall: TextInput.requestAutofill\nhandleMethodCall: TextInput.clearClient\nhandleMethodCall: TextInput.hide\n```\n\nIn the multi-field case, `clearTextInputClient` is called before\n`setTextInputClient` for the next field. Calling `removeFromSuperview`\nduring `clearTextInputClient` causes the keyboard to briefly dismiss and\nreappear (flicker).\n\nThis PR defers the `removeFromSuperview` call from\n`clearTextInputClient` to `hideTextInput`, using a pending flag\n(`_pendingInputViewRemoval`). The input view is removed only after\n`resignFirstResponder` dismisses the keyboard. `showTextInput` resets\nthe flag to prevent stale flags from causing unintended removal when\nswitching fields.\n\nFor autofill contexts, a separate flag (`_pendingAutofillRemoval`)\ndefers removal to `triggerAutofillSave`, preserving the existing\nautofill save behavior.\n\n\nhttps://github.com/user-attachments/assets/751dd6b9-cfc0-401c-a924-c359ae5bc179\n\n\nhttps://github.com/user-attachments/assets/cb0831e4-4312-46be-b40e-03df939ad2d5\n\n## Pre-launch Checklist\n\n- [x] I read the [Contributor Guide] and followed the process outlined\nthere for submitting PRs.\n- [x] I read the [Tree Hygiene] wiki page, which explains my\nresponsibilities.\n- [x] I read and followed the [Flutter Style Guide], including [Features\nwe expect every widget to implement].\n- [x] I signed the [CLA].\n- [x] I listed at least one issue that this PR fixes in the description\nabove.\n- [x] I updated/added relevant documentation (doc comments with `///`).\n- [x] I added new tests to check the change I am making, or this PR is\n[test-exempt].\n- [x] I followed the [breaking change policy] and added [Data Driven\nFixes] where supported.\n- [x] All existing and new tests are passing.\n\nIf you need help, consider asking for advice on the #hackers-new channel\non [Discord].\n\n**Note**: The Flutter team is currently trialing the use of [Gemini Code\nAssist for\nGitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).\nComments from the `gemini-code-assist` bot should not be taken as\nauthoritative feedback from the Flutter team. If you find its comments\nuseful you can update your code accordingly, but if you are unsure or\ndisagree with the feedback, please feel free to wait for a Flutter team\nmember\u0027s review for guidance on which automated comments should be\naddressed.\n\n\u003c!-- Links --\u003e\n[Contributor Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview\n[Tree Hygiene]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md\n[test-exempt]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests\n[Flutter Style Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md\n[Features we expect every widget to implement]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement\n[CLA]: https://cla.developers.google.com/\n[flutter/tests]: https://github.com/flutter/tests\n[breaking change policy]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes\n[Discord]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md\n[Data Driven Fixes]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2609df3a9e887136633ced49e45e46bb5c8ed6d0",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm",
      "new_id": "ec28890c13210c8e92c4b25903d737d6bd2da686",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm"
    },
    {
      "type": "modify",
      "old_id": "72d3a183b79a56733cea3333a8a6d8653b154fc2",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm",
      "new_id": "57011a3d47bf6a6e087abe3ca25176414b906fdc",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm"
    }
  ]
}
