Explorar el Código

Fix the timing of calling _notifyEditableRect

xuty hace 2 años
padre
commit
aa985c7756
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. 2 3
      lib/src/ui/render.dart

+ 2 - 3
lib/src/ui/render.dart

@@ -189,6 +189,7 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
   void _onScroll() {
     _stickToBottom = _scrollOffset >= _maxScrollExtent;
     markNeedsLayout();
+    _notifyEditableRect();
   }
 
   void _onFocusChange() {
@@ -197,6 +198,7 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
 
   void _onTerminalChange() {
     markNeedsLayout();
+    _notifyEditableRect();
   }
 
   void _onControllerUpdate() {
@@ -247,9 +249,6 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
     if (_stickToBottom) {
       _offset.correctBy(_maxScrollExtent - _scrollOffset);
     }
-
-    SchedulerBinding.instance
-        .addPostFrameCallback((_) => _notifyEditableRect());
   }
 
   /// Total height of the terminal in pixels. Includes scrollback buffer.