diff --git a/super_editor/lib/src/default_editor/document_gestures_touch_android.dart b/super_editor/lib/src/default_editor/document_gestures_touch_android.dart index fa64cceec0..f8b8e69751 100644 --- a/super_editor/lib/src/default_editor/document_gestures_touch_android.dart +++ b/super_editor/lib/src/default_editor/document_gestures_touch_android.dart @@ -412,7 +412,6 @@ class SuperEditorAndroidHandlesDocumentLayerBuilder implements SuperEditorLayerB ]); }, caretWidth: caretWidth, - areSelectionHandlesAllowed: SuperEditorAndroidControlsScope.rootOf(context).areSelectionHandlesAllowed, caretColor: caretColor, ); } @@ -1760,6 +1759,7 @@ class SuperEditorAndroidControlsOverlayManagerState extends State? areSelectionHandlesAllowed; - final bool showDebugPaint; @override @@ -211,11 +207,13 @@ class AndroidControlsDocumentLayerState _controlsController!.shouldCaretBlink.removeListener(_onBlinkModeChange); _controlsController!.caretJumpToOpaqueSignal.removeListener(_caretJumpToOpaque); _controlsController!.shouldShowCollapsedHandle.removeListener(_onShouldShowCollapsedHandleChange); + _controlsController!.areSelectionHandlesAllowed.removeListener(_onSelectionHandlesAllowedChange); } _controlsController = SuperEditorAndroidControlsScope.rootOf(context); _controlsController!.shouldCaretBlink.addListener(_onBlinkModeChange); _controlsController!.caretJumpToOpaqueSignal.addListener(_caretJumpToOpaque); + _controlsController!.areSelectionHandlesAllowed.addListener(_onSelectionHandlesAllowedChange); /// Listen for changes about whether we want to show the collapsed handle /// or whether we want to show expanded handles for a selection. We listen to @@ -242,6 +240,7 @@ class AndroidControlsDocumentLayerState widget.selection.removeListener(_onSelectionChange); _controlsController?.shouldCaretBlink.removeListener(_onBlinkModeChange); _controlsController!.shouldShowCollapsedHandle.removeListener(_onShouldShowCollapsedHandleChange); + _controlsController!.areSelectionHandlesAllowed.removeListener(_onSelectionHandlesAllowedChange); _caretBlinkController.dispose(); super.dispose(); @@ -315,6 +314,12 @@ class AndroidControlsDocumentLayerState }); } + void _onSelectionHandlesAllowedChange() { + setState(() { + // + }); + } + @override DocumentSelectionLayout? computeLayoutDataWithDocumentLayout( BuildContext contentLayersContext, BuildContext documentContext, DocumentLayout documentLayout) { @@ -323,7 +328,7 @@ class AndroidControlsDocumentLayerState return null; } - if (widget.areSelectionHandlesAllowed?.value == false) { + if (_controlsController!.areSelectionHandlesAllowed.value == false) { // We don't want to show any selection handles. return null; } diff --git a/super_editor_spellcheck/lib/src/super_editor/spelling_and_grammar_plugin.dart b/super_editor_spellcheck/lib/src/super_editor/spelling_and_grammar_plugin.dart index 038b902964..dcfb7f1650 100644 --- a/super_editor_spellcheck/lib/src/super_editor/spelling_and_grammar_plugin.dart +++ b/super_editor_spellcheck/lib/src/super_editor/spelling_and_grammar_plugin.dart @@ -198,6 +198,7 @@ extension SpellingAndGrammarEditorExtensions on Editor { ), ), ), + const ClearComposingRegionRequest(), ]); } }