fix(ui): move tap region to wrap autocomplete optionsViewBuilder

This commit is contained in:
geweald
2023-05-25 14:15:30 +02:00
parent 31af098709
commit e46be5d8ae
@@ -507,10 +507,12 @@ class _StreamAutocompleteState extends State<StreamAutocomplete> {
final anchor = widget.optionsAlignment._toAnchor(); final anchor = widget.optionsAlignment._toAnchor();
final shouldShowOptions = _shouldShowOptions; final shouldShowOptions = _shouldShowOptions;
final optionViewBuilder = shouldShowOptions final optionViewBuilder = shouldShowOptions
? _currentTrigger!.optionsViewBuilder( ? TextFieldTapRegion(
child: _currentTrigger!.optionsViewBuilder(
context, context,
_currentQuery!, _currentQuery!,
_messageEditingController, _messageEditingController,
),
) )
: null; : null;
@@ -610,8 +612,7 @@ class StreamAutocompleteOptions<T extends Object> extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final height = MediaQuery.of(context).size.height; final height = MediaQuery.of(context).size.height;
final colorTheme = StreamChatTheme.of(context).colorTheme; final colorTheme = StreamChatTheme.of(context).colorTheme;
return TextFieldTapRegion( return Card(
child: Card(
margin: margin, margin: margin,
elevation: elevation, elevation: elevation,
color: color ?? colorTheme.barsBg, color: color ?? colorTheme.barsBg,
@@ -638,7 +639,6 @@ class StreamAutocompleteOptions<T extends Object> extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }
} }