diff --git a/lib/src/editor/block_component/base_component/selection/block_selection_area.dart b/lib/src/editor/block_component/base_component/selection/block_selection_area.dart index 19ba05ed1..3332f4770 100644 --- a/lib/src/editor/block_component/base_component/selection/block_selection_area.dart +++ b/lib/src/editor/block_component/base_component/selection/block_selection_area.dart @@ -73,6 +73,14 @@ class _BlockSelectionAreaState extends State { WidgetsBinding.instance.addPostFrameCallback((_) { _updateSelectionIfNeeded(); }); + widget.listenable.addListener(_clearCursorRect); + } + + @override + void dispose() { + widget.listenable.removeListener(_clearCursorRect); + + super.dispose(); } @override @@ -206,4 +214,8 @@ class _BlockSelectionAreaState extends State { _updateSelectionIfNeeded(); }); } + + void _clearCursorRect() { + prevCursorRect = null; + } }