)]}'
{
  "commit": "c4a2712e8f4d41f4184b4253011c312f42edfca2",
  "tree": "6036a328e43278e91a19e2a88e629a4491566a44",
  "parents": [
    "4f84cac5b740e61edbca273975989312a6386014"
  ],
  "author": {
    "name": "Bruno Leroux",
    "email": "leroux_bruno@yahoo.fr",
    "time": "Tue May 02 21:34:35 2023 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue May 02 19:34:35 2023 +0000"
  },
  "message": "Web - Fix selection jump on Chrome for Android (#41202)\n\n## Description\r\n\r\nThis PR fixes cursor jump on Chrome for Android when the user taps in a multiline `TextField`.\r\n\r\nUsing the following code sample:\r\n\r\n\u003cdetails\u003e\u003csummary\u003eCode sample\u003c/summary\u003e\r\n\r\n```dart\r\n\r\nimport \u0027package:flutter/material.dart\u0027;\r\n\r\nvoid main() \u003d\u003e runApp(const MyApp());\r\n\r\nclass MyApp extends StatelessWidget {\r\n  const MyApp({super.key});\r\n\r\n  @override\r\n  Widget build(BuildContext context) {\r\n    return const MaterialApp(\r\n      title: \u0027Text Field Focus\u0027,\r\n      home: MyCustomForm(),\r\n    );\r\n  }\r\n}\r\n\r\n// Define a custom Form widget.\r\nclass MyCustomForm extends StatelessWidget {\r\n  const MyCustomForm({super.key});\r\n\r\n  @override\r\n  Widget build(BuildContext context) {\r\n    return Scaffold(\r\n      appBar: AppBar(\r\n        title: const Text(\u0027Text Field Focus\u0027),\r\n      ),\r\n      backgroundColor: Colors.amber,\r\n      body: Padding(\r\n        padding: const EdgeInsets.all(16.0),\r\n        child: TextField(\r\n          decoration: const InputDecoration(\r\n            fillColor: Colors.white,\r\n            filled: true\r\n          ),\r\n          autofocus: true,\r\n          maxLines: 3,\r\n          controller: TextEditingController(text: \u00271\\n2\\n3\\n4\\n\u0027),\r\n        ),\r\n      ),// This trailing comma makes auto-formatting nicer for build methods.\r\n    );\r\n  }\r\n}\r\n\r\n```\r\n\u003c/details\u003e\r\n\r\nOn a mobile browser, once the page is loaded, tap after the number 3: \r\n\r\n- Before this PR: the TextField content is automaticaly scrolled and the selection is set after number 1.\r\n\r\nhttps://user-images.githubusercontent.com/840911/232051413-b913f890-6cb1-4c60-92d0-7a3bf74cc688.mov\r\n\r\n## Implementation\r\n\r\nA multiline `TextField` relies on an HTML `\u003ctextarea\u003e` elements. When a tap occurs the selection should be updated from Flutter not by the HTML element itself. \r\nThis PR prevents mouse events on Chrome for Android. Those events conflicts with Flutter selection changes.\r\nPreviously, mouse events were only prevented on desktop but they are also emitted on mobile, see https://bugs.chromium.org/p/chromium/issues/detail?id\u003d119216#c11.\r\n\r\n## Related Issue\r\n\r\nRelated to https://github.com/flutter/flutter/issues/124483 (partial fix because the issue is also reproducible on iOS/Safari).\r\n\r\n## Tests\r\n\r\nAdds 1 test.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2be73503270a97995447f2c8fbf5e74b6f9de845",
      "old_mode": 33188,
      "old_path": "lib/web_ui/lib/src/engine/text_editing/text_editing.dart",
      "new_id": "f8c9127d27b63bfe64c06d5cb473a7d8292a7053",
      "new_mode": 33188,
      "new_path": "lib/web_ui/lib/src/engine/text_editing/text_editing.dart"
    },
    {
      "type": "modify",
      "old_id": "830be7b916b8aed53bcb3211ce26be86a8b6fa66",
      "old_mode": 33188,
      "old_path": "lib/web_ui/test/engine/text_editing_test.dart",
      "new_id": "4e6a3763063a4aa3971069415ec733cb16d80f6b",
      "new_mode": 33188,
      "new_path": "lib/web_ui/test/engine/text_editing_test.dart"
    }
  ]
}
