From 83ad28bf7bddd46277e5cecb746b6827d7ca121c Mon Sep 17 00:00:00 2001 From: sourabhguptazeil <108905944+sourabhguptazeil@users.noreply.github.com> Date: Fri, 17 Feb 2023 03:11:06 +1300 Subject: [PATCH] Added a property to control the detect word boundary behaviour (#1103) --- lib/src/widgets/delegate.dart | 3 ++- lib/src/widgets/editor.dart | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/delegate.dart b/lib/src/widgets/delegate.dart index a7ad9866..1de60822 100644 --- a/lib/src/widgets/delegate.dart +++ b/lib/src/widgets/delegate.dart @@ -341,7 +341,8 @@ class EditorTextSelectionGestureDetectorBuilder { /// /// The [child] or its subtree should contain [EditableText]. Widget build( - {required HitTestBehavior behavior, required Widget child, Key? key}) { + {required HitTestBehavior behavior, required Widget child, Key? key, + bool detectWordBoundary = true}) { return EditorTextSelectionGestureDetector( key: key, onTapDown: onTapDown, diff --git a/lib/src/widgets/editor.dart b/lib/src/widgets/editor.dart index b8d007d2..fcf1e9d3 100644 --- a/lib/src/widgets/editor.dart +++ b/lib/src/widgets/editor.dart @@ -522,6 +522,7 @@ class QuillEditorState extends State child: selectionEnabled ? _selectionGestureDetectorBuilder.build( behavior: HitTestBehavior.translucent, + detectWordBoundary: widget.detectWordBoundary, child: child, ) : child,