Persist boolean logic for showSelectionToolbar

pull/1320/head
operatorultra 2 years ago
parent 0885d4fd54
commit 3f3614e786
  1. 9
      lib/src/widgets/editor.dart

@ -191,6 +191,7 @@ class QuillEditor extends StatefulWidget {
this.customLinkPrefixes = const <String>[],
this.dialogTheme,
this.contentInsertionConfiguration,
this.contextMenuBuilder,
Key? key,
}) : super(key: key);
@ -432,6 +433,9 @@ class QuillEditor extends StatefulWidget {
/// Configures the dialog theme.
final QuillDialogTheme? dialogTheme;
// Allows for creating a custom context menu
final QuillEditorContextMenuBuilder? contextMenuBuilder;
/// Configuration of handler for media content inserted via the system input
/// method.
///
@ -503,8 +507,9 @@ class QuillEditorState extends State<QuillEditor>
readOnly: widget.readOnly,
placeholder: widget.placeholder,
onLaunchUrl: widget.onLaunchUrl,
contextMenuBuilder:
showSelectionToolbar ? RawEditor.defaultContextMenuBuilder : null,
contextMenuBuilder: showSelectionToolbar
? (widget.contextMenuBuilder ?? RawEditor.defaultContextMenuBuilder)
: null,
showSelectionHandles: isMobile(theme.platform),
showCursor: widget.showCursor,
cursorStyle: CursorStyle(

Loading…
Cancel
Save