@@ -973,14 +973,13 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
973973 }
974974 if (growDown) {
975975 adjustMinYExtent();
976− } else if (remove.index <= m_firstVisibleIndex) {
977− if (!m_visibleItems.isEmpty()) {
978− // We removed the first item that is the one that positions the rest
979− // position the new first item correctly
980− m_visibleItems.first()->setY(oldFirstValidIndexPos);
981− } else {
982− m_firstVisibleIndex = -1;
983− }
976+ } else if (remove.index <= m_firstVisibleIndex && !m_visibleItems.isEmpty()) {
977+ m_visibleItems.first()->setY(oldFirstValidIndexPos);
978+ }
979+ if (m_visibleItems.isEmpty()) {
980+ m_firstVisibleIndex = -1;
981+ } else {
982+ m_firstVisibleIndex -= qMax(0, m_firstVisibleIndex - remove.index);
984983 }
985984 } else if (remove.index + remove.count <= m_firstVisibleIndex) {
986985 m_firstVisibleIndex -= remove.count;