Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/src/chips_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class ChipsInput<T> extends StatefulWidget {
this.allowChipEditing = false,
this.focusNode,
this.initialSuggestions,
this.showKeyboard = true,
}) : assert(maxChips == null || initialValue.length <= maxChips),
super(key: key);

Expand All @@ -78,6 +79,7 @@ class ChipsInput<T> extends StatefulWidget {
final bool allowChipEditing;
final FocusNode focusNode;
final List<T> initialSuggestions;
final bool showKeyboard;

// final Color cursorColor;

Expand Down Expand Up @@ -164,8 +166,9 @@ class ChipsInputState<T> extends State<ChipsInput<T>>

void _handleFocusChanged() {
if (_focusNode.hasFocus) {
_openInputConnection();
_suggestionsBoxController.open();
if (widget.showKeyboard) {
_openInputConnection();
}
} else {
_closeInputConnectionIfNeeded();
_suggestionsBoxController.close();
Expand Down Expand Up @@ -262,6 +265,9 @@ class ChipsInputState<T> extends State<ChipsInput<T>>
_suggestionsBoxController.close();
}
widget.onChanged(_chips.toList(growable: false));
if (!widget.showKeyboard) {
_focusNode.unfocus();
}
}

void deleteChip(T data) {
Expand Down