diff --git a/super_editor/lib/src/default_editor/document_gestures_touch_ios.dart b/super_editor/lib/src/default_editor/document_gestures_touch_ios.dart index d2c3a460e9..6281a1f6f1 100644 --- a/super_editor/lib/src/default_editor/document_gestures_touch_ios.dart +++ b/super_editor/lib/src/default_editor/document_gestures_touch_ios.dart @@ -129,7 +129,7 @@ class SuperEditorIosControlsController { /// Whether the caret (collapsed handle) should blink right now. ValueListenable get shouldCaretBlink => _shouldCaretBlink; - final _shouldCaretBlink = ValueNotifier(false); + final _shouldCaretBlink = ValueNotifier(true); /// Tells the caret to blink by setting [shouldCaretBlink] to `true`. void blinkCaret() => _shouldCaretBlink.value = true; diff --git a/super_editor/lib/src/default_editor/document_ime/supereditor_ime_interactor.dart b/super_editor/lib/src/default_editor/document_ime/supereditor_ime_interactor.dart index 52ce896a9a..c558cc826e 100644 --- a/super_editor/lib/src/default_editor/document_ime/supereditor_ime_interactor.dart +++ b/super_editor/lib/src/default_editor/document_ime/supereditor_ime_interactor.dart @@ -293,9 +293,12 @@ class SuperEditorImeInteractorState extends State impl return; } - _reportSizeAndTransformToIme(); - _reportCaretRectToIme(); - _reportTextStyleToIme(); + final myRenderBox = context.findRenderObject() as RenderBox?; + if (myRenderBox != null && myRenderBox.hasSize) { + _reportSizeAndTransformToIme(); + _reportCaretRectToIme(); + _reportTextStyleToIme(); + } // There are some operations that might affect our transform, size and the caret rect, // but we can't react to them. diff --git a/super_editor/lib/src/default_editor/super_editor.dart b/super_editor/lib/src/default_editor/super_editor.dart index 7405fbace8..41d71dafad 100644 --- a/super_editor/lib/src/default_editor/super_editor.dart +++ b/super_editor/lib/src/default_editor/super_editor.dart @@ -554,7 +554,8 @@ class SuperEditorState extends State { editor: widget.editor, document: widget.document, selection: _composer.selectionNotifier, - isDocumentLayoutAvailable: () => _docLayoutKey.currentContext != null, + isDocumentLayoutAvailable: () => + (_docLayoutKey.currentContext?.findRenderObject() as RenderBox?)?.hasSize == true, getDocumentLayout: () => editContext.documentLayout, placeCaretAtEndOfDocumentOnGainFocus: widget.selectionPolicies.placeCaretAtEndOfDocumentOnGainFocus, restorePreviousSelectionOnGainFocus: widget.selectionPolicies.restorePreviousSelectionOnGainFocus,