From bd0ca1afd245c79f5bd3a7a37b5baef0dcc1570f Mon Sep 17 00:00:00 2001 From: smalla Date: Mon, 16 Jan 2023 11:11:28 +0100 Subject: [PATCH] make ensureVisible optional. Jumping to the focused input field is odd behaviour for desktop and web plattforms --- lib/src/chips_input.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/chips_input.dart b/lib/src/chips_input.dart index 3c10a20d..464c5cd4 100644 --- a/lib/src/chips_input.dart +++ b/lib/src/chips_input.dart @@ -43,6 +43,7 @@ class ChipsInput extends StatefulWidget { this.textOverflow = TextOverflow.clip, this.obscureText = false, this.autocorrect = true, + this.ensureVisible = true, this.actionLabel, this.inputAction = TextInputAction.done, this.keyboardAppearance = Brightness.light, @@ -72,6 +73,7 @@ class ChipsInput extends StatefulWidget { final TextInputAction inputAction; final Brightness keyboardAppearance; final bool autofocus; + final bool ensureVisible; final bool allowChipEditing; final FocusNode? focusNode; final List? initialSuggestions; @@ -281,7 +283,9 @@ class ChipsInputState extends State> _textInputConnection?.show(); } - _scrollToVisible(); + if (widget.ensureVisible) { + _scrollToVisible(); + } } void _scrollToVisible() {