From e178c7c4f4690e7deb28ed98f8d60efab5256fe0 Mon Sep 17 00:00:00 2001 From: appflowy Date: Tue, 20 Sep 2022 21:14:57 +0800 Subject: [PATCH] fix: set the leader size when attach get called --- .../packages/appflowy_popover/lib/src/layout.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/app_flowy/packages/appflowy_popover/lib/src/layout.dart b/frontend/app_flowy/packages/appflowy_popover/lib/src/layout.dart index d589f18723..f9763db15b 100644 --- a/frontend/app_flowy/packages/appflowy_popover/lib/src/layout.dart +++ b/frontend/app_flowy/packages/appflowy_popover/lib/src/layout.dart @@ -323,9 +323,21 @@ class PopoverTargetRenderBox extends RenderProxyBox { @override void detach() { + super.detach(); link.leaderOffset = null; link.leaderSize = null; - super.detach(); + } + + @override + void attach(covariant PipelineOwner owner) { + super.attach(owner); + if (hasSize) { + // The leaderSize was set after [performLayout], but was + // set to null when [detach] get called. + // + // set the leaderSize when attach get called + link.leaderSize = size; + } } @override