diff --git a/frameworks/core/components_ng/pattern/list/list_pattern.cpp b/frameworks/core/components_ng/pattern/list/list_pattern.cpp index 5b692d33a48..53eb230fc0f 100644 --- a/frameworks/core/components_ng/pattern/list/list_pattern.cpp +++ b/frameworks/core/components_ng/pattern/list/list_pattern.cpp @@ -2007,6 +2007,13 @@ void ListPattern::ProcessDragUpdate(float dragOffset, int32_t source) } bool overDrag = (source == SCROLL_FROM_UPDATE) && (IsAtTop() || IsAtBottom()); chainAnimation_->SetDelta(-dragOffset, overDrag); + if (source == SCROLL_FROM_UPDATE && GetCanOverScroll()) { + float tempDelta = currentDelta_; + currentDelta_ -= dragOffset; + bool isAtEdge = IsAtTop() || IsAtBottom(); + currentDelta_ = tempDelta; + SetCanOverScroll(isAtEdge); + } } float ListPattern::GetChainDelta(int32_t index) const diff --git a/frameworks/core/components_ng/pattern/scrollable/scrollable_pattern.h b/frameworks/core/components_ng/pattern/scrollable/scrollable_pattern.h index 61b7a0c2389..18689c45e19 100644 --- a/frameworks/core/components_ng/pattern/scrollable/scrollable_pattern.h +++ b/frameworks/core/components_ng/pattern/scrollable/scrollable_pattern.h @@ -752,6 +752,9 @@ protected: return scrollOriginChild_.Upgrade(); } + void SetCanOverScroll(bool val); + bool GetCanOverScroll() const; + private: virtual void OnScrollEndCallback() {}; @@ -820,9 +823,6 @@ private: void ExecuteScrollFrameBegin(float& mainDelta, ScrollState state); - void SetCanOverScroll(bool val); - bool GetCanOverScroll() const; - void OnScrollEnd(); void ProcessSpringEffect(float velocity, bool needRestart = false); void SetEdgeEffect(EdgeEffect edgeEffect);