diff --git a/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp b/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp index c7a1bf23e7568d3b8158f0576e853966cfdff266..46ae83e968c6f120854376345b9bb184798f6ce7 100644 --- a/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp +++ b/frameworks/core/components_ng/pattern/swiper/swiper_pattern.cpp @@ -2495,6 +2495,7 @@ void SwiperPattern::HandleDragEnd(double dragVelocity) } if (pipeline) { pipeline->FlushUITasks(); + pipeline->FlushMessages(); } isDragging_ = false; diff --git a/frameworks/core/components_ng/pattern/tabs/tab_content_pattern.h b/frameworks/core/components_ng/pattern/tabs/tab_content_pattern.h index 62af1615f25f26b36048d9f3ef7878a5b191d361..4eebad1377686cc960ee498749558127e124b5f3 100644 --- a/frameworks/core/components_ng/pattern/tabs/tab_content_pattern.h +++ b/frameworks/core/components_ng/pattern/tabs/tab_content_pattern.h @@ -34,9 +34,24 @@ class ACE_EXPORT TabContentPattern : public Pattern { public: explicit TabContentPattern(const RefPtr& shallowBuilder) : shallowBuilder_(shallowBuilder), tabBarParam_(std::string(""), std::string(""), nullptr) - {} + { + if (shallowBuilder_) { + shallowBuilder_->MarkIsExecuteDeepRenderDone(true); + } + } ~TabContentPattern() override = default; + bool OnDirtyLayoutWrapperSwap(const RefPtr& dirty, const DirtySwapConfig& config) override + { + if (shallowBuilder_ && !shallowBuilder_->IsExecuteDeepRenderDone()) { + auto host = GetHost(); + CHECK_NULL_RETURN(host, false); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + return true; + } + return false; + } + bool IsAtomicNode() const override { return false; @@ -65,6 +80,22 @@ public: if (shallowBuilder_ && !shallowBuilder_->IsExecuteDeepRenderDone()) { shallowBuilder_->ExecuteDeepRender(); shallowBuilder_.Reset(); + } else if (shallowBuilder_ && shallowBuilder_->IsExecuteDeepRenderDone()) { + auto pipeline = PipelineContext::GetCurrentContextSafely(); + if (!pipeline) { + shallowBuilder_->MarkIsExecuteDeepRenderDone(false); + return; + } + + pipeline->AddAfterRenderTask([weak = WeakClaim(this), shallowBuilder = shallowBuilder_]() { + CHECK_NULL_VOID(shallowBuilder); + shallowBuilder->MarkIsExecuteDeepRenderDone(false); + auto pattern = weak.Upgrade(); + CHECK_NULL_VOID(pattern); + auto host = pattern->GetHost(); + CHECK_NULL_VOID(host); + host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF); + }); } }