Skip to content

Commit

Permalink
Fix: Unable to scroll 2nd editor window (#2152)
Browse files Browse the repository at this point in the history
* Value setting Stateful toolbar buttons derive from base class

* Removed deprecated functions

* Move clipboard actions to QuillController

* Add: Clipboard toolbar buttons

* Translation Justify

* Translation alignJustify

* Fix: Translation en-US

* Fix Unable to scroll when create 2nd editor

---------

Co-authored-by: Douglas Ward <[email protected]>
  • Loading branch information
AtlasAutocode and Douglas Ward authored Aug 26, 2024
1 parent 25fb941 commit fed1bda
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import 'package:flutter/widgets.dart';
/// Very similar to [SingleChildView] but with a [ViewportBuilder] argument
/// instead of a [Widget]
///
/// Useful when child needs [ViewportOffset] (e.g. [RenderEditor])
/// Useful when child needs [ViewportOffset] ([RenderEditor] no longer uses this class!)
/// see: [SingleChildScrollView]
@Deprecated(
'This class is no longer being used and will be removed in future versions. If you disagree, please open an issue.')
class QuillSingleChildScrollView extends StatelessWidget {
/// Creates a box in which a single widget can be scrolled.
const QuillSingleChildScrollView({
Expand Down
51 changes: 23 additions & 28 deletions lib/src/editor/raw_editor/raw_editor_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import '../widgets/proxy.dart';
import '../widgets/text/text_block.dart';
import '../widgets/text/text_line.dart';
import '../widgets/text/text_selection.dart';
import 'quill_single_child_scroll_view.dart';
import 'raw_editor.dart';
import 'raw_editor_actions.dart';
import 'raw_editor_render_object.dart';
Expand Down Expand Up @@ -439,35 +438,31 @@ class QuillRawEditorState extends EditorState
textStyle: _styles!.paragraph!.style,
padding: baselinePadding,
child: _scribbleFocusable(
QuillSingleChildScrollView(
SingleChildScrollView(
controller: _scrollController,
physics: widget.configurations.scrollPhysics,
viewportBuilder: (_, offset) => CompositedTransformTarget(
link: _toolbarLayerLink,
child: MouseRegion(
cursor: widget.configurations.readOnly
? widget.configurations.readOnlyMouseCursor
: SystemMouseCursors.text,
child: QuillRawEditorMultiChildRenderObject(
key: _editorKey,
offset: offset,
document: doc,
selection: controller.selection,
hasFocus: _hasFocus,
scrollable: widget.configurations.scrollable,
textDirection: _textDirection,
startHandleLayerLink: _startHandleLayerLink,
endHandleLayerLink: _endHandleLayerLink,
onSelectionChanged: _handleSelectionChanged,
onSelectionCompleted: _handleSelectionCompleted,
scrollBottomInset: widget.configurations.scrollBottomInset,
padding: widget.configurations.padding,
maxContentWidth: widget.configurations.maxContentWidth,
cursorController: _cursorCont,
floatingCursorDisabled:
widget.configurations.floatingCursorDisabled,
children: _buildChildren(doc, context),
),
child: MouseRegion(
cursor: widget.configurations.readOnly
? widget.configurations.readOnlyMouseCursor
: SystemMouseCursors.text,
child: QuillRawEditorMultiChildRenderObject(
key: _editorKey,
document: doc,
selection: controller.selection,
hasFocus: _hasFocus,
scrollable: widget.configurations.scrollable,
textDirection: _textDirection,
startHandleLayerLink: _startHandleLayerLink,
endHandleLayerLink: _endHandleLayerLink,
onSelectionChanged: _handleSelectionChanged,
onSelectionCompleted: _handleSelectionCompleted,
scrollBottomInset: widget.configurations.scrollBottomInset,
padding: widget.configurations.padding,
maxContentWidth: widget.configurations.maxContentWidth,
cursorController: _cursorCont,
floatingCursorDisabled:
widget.configurations.floatingCursorDisabled,
children: _buildChildren(doc, context),
),
),
),
Expand Down

0 comments on commit fed1bda

Please sign in to comment.