From c033b08df79cbb42ce6147027e84229177e39087 Mon Sep 17 00:00:00 2001 From: Satsrag Date: Wed, 3 Jan 2024 09:58:24 +0800 Subject: [PATCH] fix: cannot input new line using custom input control (#140356) For https://github.com/flutter/flutter/issues/125875 and https://github.com/flutter/engine/pull/45522 According to [this discussion](https://github.com/flutter/flutter/pull/139446#discussion_r1424776370), Just added `forceMultiline` to JSON on `_configurationToJson`. @LongCatIsLooong @Renzo-Olivares --- .../flutter/lib/src/services/text_input.dart | 10 ++- .../test/services/text_input_test.dart | 85 ++++++++++++++++--- 2 files changed, 82 insertions(+), 13 deletions(-) diff --git a/packages/flutter/lib/src/services/text_input.dart b/packages/flutter/lib/src/services/text_input.dart index 28d5cbf7c3..38dd2fc034 100644 --- a/packages/flutter/lib/src/services/text_input.dart +++ b/packages/flutter/lib/src/services/text_input.dart @@ -2226,7 +2226,15 @@ class _PlatformTextInputControl with TextInputControl { Map _configurationToJson(TextInputConfiguration configuration) { final Map json = configuration.toJson(); if (TextInput._instance._currentControl != _PlatformTextInputControl.instance) { - json['inputType'] = TextInputType.none.toJson(); + final Map none = TextInputType.none.toJson(); + // See: https://github.com/flutter/flutter/issues/125875 + // On Web engine, use isMultiline to create or