From 87255ecdc07f40632d73c18b9f58c311a31d8d9a Mon Sep 17 00:00:00 2001 From: Kelrap Date: Tue, 6 Aug 2024 10:05:16 -0400 Subject: [PATCH] Fix mention suggestion overflow --- lib/pages/chat/input_bar.dart | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/pages/chat/input_bar.dart b/lib/pages/chat/input_bar.dart index 4a524bf5f..aea82a886 100644 --- a/lib/pages/chat/input_bar.dart +++ b/lib/pages/chat/input_bar.dart @@ -221,7 +221,6 @@ class InputBar extends StatelessWidget { } } } - print("ret length: ${ret.length}"); return ret; } @@ -231,7 +230,10 @@ class InputBar extends StatelessWidget { Client? client, ) { const size = 30.0; - const padding = EdgeInsets.all(4.0); + // #Pangea + // const padding = EdgeInsets.all(4.0); + const padding = EdgeInsets.all(8.0); + // Pangea# if (suggestion['type'] == 'command') { final command = suggestion['name']!; final hint = commandHint(L10n.of(context)!, command); @@ -323,7 +325,17 @@ class InputBar extends StatelessWidget { client: client, ), const SizedBox(width: 6), - Text(suggestion['displayname'] ?? suggestion['mxid']!), + // #Pangea + Flexible( + child: + // Pangea# + Text( + suggestion['displayname'] ?? suggestion['mxid']!, + // #Pangea + overflow: TextOverflow.ellipsis, + // Pangea# + ), + ), ], ), ); @@ -536,6 +548,15 @@ class InputBar extends StatelessWidget { // fix loading briefly flickering a dark box emptyBuilder: (BuildContext context) => const SizedBox .shrink(), // fix loading briefly showing no suggestions + // #Pangea + // If we ever want to change the suggestion background color + // here is the code for it + // decorationBuilder: (context, child) => Material( + // borderRadius: BorderRadius.circular(AppConfig.borderRadius), + // color: Theme.of(context).colorScheme.surfaceContainerHigh, + // child: child, + // ), + // Pangea# ), ), ),