diff --git a/frameworks/core/components_ng/pattern/refresh/refresh_pattern.cpp b/frameworks/core/components_ng/pattern/refresh/refresh_pattern.cpp index 13eda56b2de..0608aea57a9 100644 --- a/frameworks/core/components_ng/pattern/refresh/refresh_pattern.cpp +++ b/frameworks/core/components_ng/pattern/refresh/refresh_pattern.cpp @@ -576,7 +576,7 @@ void RefreshPattern::AddCustomBuilderNode(const RefPtr& builder) if (!isCustomBuilderExist_) { if (progressChild_) { - if (hasLoadingText_) { + if (columnNode_) { host->RemoveChild(columnNode_); columnNode_ = nullptr; loadingTextNode_ = nullptr; @@ -742,7 +742,7 @@ void RefreshPattern::UpdateScrollTransition(float scrollOffset) CHECK_NULL_VOID(host); int32_t childCount = host->TotalChildCount(); // If the refresh has no children without loadingProgress and text, it does not need to update offset. - if (childCount < 2 || (childCount == 2 && hasLoadingText_)) { // 2 means loadingProgress and text child components. + if (childCount < 2 || (childCount == 2 && columnNode_)) { // 2 means loadingProgress and text child components. return; } // Need to search for frameNode and skip ComponentNode @@ -803,7 +803,7 @@ float RefreshPattern::GetLoadingVisibleHeight() CHECK_NULL_RETURN(renderContext, 0.0f); auto geometryNode = progressChild_->GetGeometryNode(); CHECK_NULL_RETURN(geometryNode, 0.0f); - if (hasLoadingText_) { + if (loadingTextNode_) { auto loadingTextGeometryNode = loadingTextNode_->GetGeometryNode(); CHECK_NULL_RETURN(loadingTextGeometryNode, 0.0f); loadingHeight = geometryNode->GetFrameSize().Height() + loadingTextGeometryNode->GetFrameSize().Height() +