From 21226ca516611b2de868886f21ac35f14df43d25 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Wed, 9 Oct 2024 09:30:57 -0400 Subject: [PATCH] don't adjust overlay message height if there's enough space to accomodate it --- lib/pangea/widgets/chat/message_selection_overlay.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/pangea/widgets/chat/message_selection_overlay.dart b/lib/pangea/widgets/chat/message_selection_overlay.dart index edd96aedf..b44aad7f6 100644 --- a/lib/pangea/widgets/chat/message_selection_overlay.dart +++ b/lib/pangea/widgets/chat/message_selection_overlay.dart @@ -267,12 +267,20 @@ class MessageOverlayController extends State animationEndOffset = footerHeight; } + // If, after ajusting the overlay position, the message still overflows the footer, + // update the message height to fit the screen. The message is scrollable, so + // this will make the both the toolbar box and the toolbar buttons visible. if (animationEndOffset < footerHeight + toolbarButtonsHeight) { - adjustedMessageHeight = screenHeight - + final double remainingSpace = screenHeight - AppConfig.toolbarMaxHeight - headerHeight - footerHeight - toolbarButtonsHeight; + + if (remainingSpace < messageSize!.height) { + adjustedMessageHeight = remainingSpace; + } + animationEndOffset = footerHeight; }