diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index 7a54a8084735..51b9d1f5f5da 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -603,7 +603,9 @@ bool ScrollView::scrollChildren(float touchOffsetX, float touchOffsetY) processScrollEvent(MoveDirection::RIGHT, false); } - return !scrolledToBottom && !scrolledToTop && !scrolledToLeft && !scrolledToRight; + bool scrollEnabledUpDown = (!scrolledToBottom && !scrolledToTop); + bool scrollEnabledLeftRight = (!scrolledToLeft && !scrolledToRight); + return scrollEnabledUpDown || scrollEnabledLeftRight; } void ScrollView::scrollToBottom(float second, bool attenuated)