@@ -1303,7 +1303,7 @@ public final class ListView : UIView
13031303 /// asynchronously update the underlying `contentSize` as part of the initial layout,
13041304 /// moments after this method is executed. The list's `contentSize` is overridden to
13051305 /// keep the offset anchored to the bottom when using `VerticalLayoutGravity.bottom`.
1306- collectionView . performBatchUpdates ( nil )
1306+ performEmptyBatchUpdates ( )
13071307 }
13081308
13091309 guard self . scrollTo ( item: destination, position: info. position, animated: animated) else { return }
@@ -1316,7 +1316,7 @@ public final class ListView : UIView
13161316 /// `prepare()` function will synchronously execute before calling `didPerform`. Otherwise,
13171317 /// the list's `visibleContent` and the resulting `scrollPositionInfo.visibleItems` will
13181318 /// be stale.
1319- collectionView . performBatchUpdates ( nil )
1319+ performEmptyBatchUpdates ( )
13201320 info. didPerform ( scrollPositionInfo)
13211321 }
13221322 }
@@ -1409,6 +1409,16 @@ public final class ListView : UIView
14091409 return true
14101410 }
14111411
1412+ /// This is similar to calling `collectionView.performBatchUpdates(nil)`, but
1413+ /// it also includes workarounds for first responder bugs on iOS 16.4 and 17.0.
1414+ private func performEmptyBatchUpdates( ) {
1415+ collectionView. performBatchUpdates (
1416+ { } ,
1417+ changes: CollectionViewChanges . empty,
1418+ completion: { _ in }
1419+ )
1420+ }
1421+
14121422 private func performBatchUpdates(
14131423 with diff : SectionedDiff < Section , AnyIdentifier , AnyItem , AnyIdentifier > ,
14141424 animated: Bool ,
0 commit comments