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

Loading…
Cancel
Save