Fix AI scribe menu going off screen to the top
If it was opened at the top of the composer, it could go off screen to the top. modalHeight was missing so the calculateModalPosition method could not protect the AI scribe menu to go off screen from the top.
This commit is contained in:
@@ -67,10 +67,16 @@ Future<void> showAIScribeDialog({
|
||||
);
|
||||
|
||||
if (buttonPosition != null) {
|
||||
final categories = availableCategories ?? AIScribeMenuCategory.values;
|
||||
final modalHeight = hasContent
|
||||
? (categories.length * AIScribeSizes.menuItemHeight) + AIScribeSizes.fieldSpacing + AIScribeSizes.barHeight
|
||||
: AIScribeSizes.barHeight;
|
||||
|
||||
final position = calculateModalPosition(
|
||||
context: context,
|
||||
buttonPosition: buttonPosition,
|
||||
modalWidth: AIScribeSizes.barWidth,
|
||||
modalHeight: modalHeight,
|
||||
);
|
||||
|
||||
return PointerInterceptor(
|
||||
@@ -158,6 +164,15 @@ Future<void> showAIScribeDialog({
|
||||
);
|
||||
}
|
||||
|
||||
double calculateMenuDialogHeight({
|
||||
required bool hasContent,
|
||||
required int categoryCount,
|
||||
}) {
|
||||
return hasContent
|
||||
? (categoryCount * AIScribeSizes.menuItemHeight) + AIScribeSizes.fieldSpacing + AIScribeSizes.barHeight
|
||||
: AIScribeSizes.barHeight;
|
||||
}
|
||||
|
||||
({double left, double bottom}) calculateModalPosition({
|
||||
required BuildContext context,
|
||||
required Offset buttonPosition,
|
||||
|
||||
Reference in New Issue
Block a user