mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-02-12 22:39:50 +00:00
handle case: current index bigger than item count which after delete
This commit is contained in:
parent
a3b78c21bb
commit
f31d9e17e6
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user