if magnifier removes toolbar, restore it when it is hidden (#2049)

pull/2057/head v10.0.3
Michael Allen 9 months ago committed by GitHub
parent 9d6db48413
commit d6c74098d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  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