mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-19 22:54:50 -04:00
!30 [Lightweight PR]: handle case: current index bigger than item count which after delete
Merge pull request !30 from kukixi/N/A
This commit is contained in:
@@ -178,7 +178,9 @@ void RenderSwiper::Update(const RefPtr<Component>& component)
|
||||
|
||||
childrenArray_.clear();
|
||||
MarkNeedLayout();
|
||||
|
||||
if (currentIndex_ >= itemCount_) {
|
||||
currentIndex_ = itemCount_ > 0 ? itemCount_ - 1 : 0;
|
||||
}
|
||||
if (itemCount_ < LEAST_SLIDE_ITEM_COUNT) {
|
||||
LOGD("swiper item is less than least slide count");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user