From 893aae002e3834652d73b8627e57c8111dc137e3 Mon Sep 17 00:00:00 2001 From: Samiksha Garg <79906086+Samiksha-Garg@users.noreply.github.com> Date: Mon, 20 Mar 2023 18:41:47 +0530 Subject: [PATCH] fix: scrolling selection-menu when it goes out of bound, fixes #2019 (#2035) * fix: scrolling selection-menu when it goes out of bound * refactor: added comma as per style guidelines --- .../selection_menu_service.dart | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/frontend/appflowy_flutter/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_service.dart b/frontend/appflowy_flutter/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_service.dart index 7e0ce3eeea..b4f7bb5c67 100644 --- a/frontend/appflowy_flutter/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_service.dart +++ b/frontend/appflowy_flutter/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_service.dart @@ -91,20 +91,24 @@ class SelectionMenu implements SelectionMenuService { top: showBelow ? _offset.dy : null, bottom: showBelow ? null : _offset.dy, left: offset.dx, - child: SelectionMenuWidget( - items: [ - ..._defaultSelectionMenuItems, - ...editorState.selectionMenuItems, - ], - maxItemInRow: 5, - editorState: editorState, - menuService: this, - onExit: () { - dismiss(); - }, - onSelectionUpdate: () { - _selectionUpdateByInner = true; - }, + right: 0, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: SelectionMenuWidget( + items: [ + ..._defaultSelectionMenuItems, + ...editorState.selectionMenuItems, + ], + maxItemInRow: 5, + editorState: editorState, + menuService: this, + onExit: () { + dismiss(); + }, + onSelectionUpdate: () { + _selectionUpdateByInner = true; + }, + ), ), ); });