unfocus textfield when outside tap on mobile

This commit is contained in:
Henry Hiles 2026-11-23 14:23:00 -05:00
commit 720e538dbc
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 501 additions and 473 deletions

File diff suppressed because it is too large Load diff

View file

@ -16,27 +16,30 @@ class const TaggerOverlay(
}) extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return Padding(
padding: .all(8),
child: ClipRRect(
borderRadius: .all(.circular(12)),
child: Container(
color: Theme.of(context).colorScheme.surfaceContainerHigh,
padding: .all(8),
child: Material(
color: Colors.transparent,
child: switch (triggerCharacter) {
"@" => UserOverlay(query, roomId: roomId, addTag: addTag),
"#" => RoomOverlay(query, addTag: addTag),
":" => EmojiOverlay(
query,
roomId: roomId,
addTag: addTag,
insertText: insertText,
),
// Lives in an overlay, so taps on it would otherwise unfocus the composer
return TextFieldTapRegion(
child: Padding(
padding: .all(8),
child: ClipRRect(
borderRadius: .all(.circular(12)),
child: Container(
color: Theme.of(context).colorScheme.surfaceContainerHigh,
padding: .all(8),
child: Material(
color: Colors.transparent,
child: switch (triggerCharacter) {
"@" => UserOverlay(query, roomId: roomId, addTag: addTag),
"#" => RoomOverlay(query, addTag: addTag),
":" => EmojiOverlay(
query,
roomId: roomId,
addTag: addTag,
insertText: insertText,
),
_ => Loading(),
},
_ => Loading(),
},
),
),
),
),