From e0f7e3a489439f67ef0d2f90b2751825712e04e1 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Mon, 20 Nov 2023 19:26:20 +0800 Subject: [PATCH] fix: editor cannot scroll when editable is false --- .../entry/page_block_component.dart | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/lib/src/editor/editor_component/entry/page_block_component.dart b/lib/src/editor/editor_component/entry/page_block_component.dart index 627fcc1ba..7ac9d6f46 100644 --- a/lib/src/editor/editor_component/entry/page_block_component.dart +++ b/lib/src/editor/editor_component/entry/page_block_component.dart @@ -54,25 +54,27 @@ class PageBlockComponent extends BlockComponentStatelessWidget { if (scrollController == null || scrollController.shrinkWrap || !editorState.editable) { - return Builder( - builder: (context) { - final scroller = Scrollable.maybeOf(context); - if (scroller != null) { - editorState.updateAutoScroller(scroller); - } - return Column( - children: [ - if (header != null) header!, - ...items.map( - (e) => Padding( - padding: editorState.editorStyle.padding, - child: editorState.renderer.build(context, e), + return SingleChildScrollView( + child: Builder( + builder: (context) { + final scroller = Scrollable.maybeOf(context); + if (scroller != null) { + editorState.updateAutoScroller(scroller); + } + return Column( + children: [ + if (header != null) header!, + ...items.map( + (e) => Padding( + padding: editorState.editorStyle.padding, + child: editorState.renderer.build(context, e), + ), ), - ), - if (footer != null) footer!, - ], - ); - }, + if (footer != null) footer!, + ], + ); + }, + ), ); } else { int extentCount = 0;