Added a property to control the detect word boundary behaviour (#1103)

pull/1106/head
sourabhguptazeil 2 years ago committed by GitHub
parent c68c2bd030
commit 83ad28bf7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      lib/src/widgets/delegate.dart
  2. 1
      lib/src/widgets/editor.dart

@ -341,7 +341,8 @@ class EditorTextSelectionGestureDetectorBuilder {
/// ///
/// The [child] or its subtree should contain [EditableText]. /// The [child] or its subtree should contain [EditableText].
Widget build( Widget build(
{required HitTestBehavior behavior, required Widget child, Key? key}) { {required HitTestBehavior behavior, required Widget child, Key? key,
bool detectWordBoundary = true}) {
return EditorTextSelectionGestureDetector( return EditorTextSelectionGestureDetector(
key: key, key: key,
onTapDown: onTapDown, onTapDown: onTapDown,

@ -522,6 +522,7 @@ class QuillEditorState extends State<QuillEditor>
child: selectionEnabled child: selectionEnabled
? _selectionGestureDetectorBuilder.build( ? _selectionGestureDetectorBuilder.build(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
detectWordBoundary: widget.detectWordBoundary,
child: child, child: child,
) )
: child, : child,

Loading…
Cancel
Save