@@ -973,14 +973,13 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
974 if (growDown) {
974 if (growDown) {
975 adjustMinYExtent();
975 adjustMinYExtent();
976− } else if (remove.index <= m_firstVisibleIndex) {
976+ } else if (remove.index <= m_firstVisibleIndex && !m_visibleItems.isEmpty()) {
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);
977+ m_visibleItems.first()->setY(oldFirstValidIndexPos);
979+ if (m_visibleItems.isEmpty()) {
982− m_firstVisibleIndex = -1;
980+ m_firstVisibleIndex = -1;
982+ m_firstVisibleIndex -= qMax(0, m_firstVisibleIndex - remove.index);
985 } else if (remove.index + remove.count <= m_firstVisibleIndex) {
984 } else if (remove.index + remove.count <= m_firstVisibleIndex) {
986 m_firstVisibleIndex -= remove.count;
985 m_firstVisibleIndex -= remove.count;