if magnifier removes toolbar, restore it when it is hidden

pull/2049/head
Mike Allen 9 months ago
parent 689b8fde7c
commit da42d0110c
  1. 9
      lib/src/editor/widgets/text/text_selection.dart

@ -181,6 +181,7 @@ class EditorTextSelectionOverlay {
/// A copy/paste toolbar. /// A copy/paste toolbar.
OverlayEntry? toolbar; OverlayEntry? toolbar;
bool _restoreToolbar = false;
TextSelection get _selection => value.selection; TextSelection get _selection => value.selection;
@ -411,8 +412,12 @@ class EditorTextSelectionOverlay {
void _showMagnifier(MagnifierInfo initialMagnifierInfo) { void _showMagnifier(MagnifierInfo initialMagnifierInfo) {
// toolbar // toolbar
if (toolbar != null) { if (toolbar != null) {
_restoreToolbar = true;
hideToolbar(); hideToolbar();
} else {
_restoreToolbar = false;
} }
// magnifierInfo // magnifierInfo
_magnifierInfo.value = initialMagnifierInfo; _magnifierInfo.value = initialMagnifierInfo;
@ -456,6 +461,10 @@ class EditorTextSelectionOverlay {
return; return;
} }
_magnifierController.hide(); _magnifierController.hide();
if (_restoreToolbar) {
_restoreToolbar = false;
showToolbar();
}
} }
// build magnifier info // build magnifier info

Loading…
Cancel
Save