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