Skip to content

Commit

Permalink
Merge pull request #514 from square/kve/fix-first-responder
Browse files Browse the repository at this point in the history
Only return existing view if there is a contained first responder
  • Loading branch information
kyleve authored Nov 30, 2023
2 parents 4c96b6b + a3b66d6 commit b9f9fed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ListableUI/Sources/ListView/ListView.DataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ internal extension ListView
/// instance is kept alive by the collection view.
///
/// 3) Within this method, we check to see if there's a live, existing `visibleContainer`
/// (aka the supplementary view) view, and if there is, we return _that_, instead of
/// just dequeuing a new, wrong view.
/// (aka the supplementary view) view with a first responder in it,
/// and if there is, we return _that_, instead of just dequeuing a new, wrong view.
///
/// After all that, the correct thing happens.
///
/// PR with more info and screenshots, etc:
/// https://github.com/square/Listable/pull/507
///

if let view = statePair.visibleContainer {
if let view = statePair.visibleContainer, let state = statePair.state, state.containsFirstResponder {
return view
} else {
return SupplementaryContainerView.dequeue(
Expand Down

0 comments on commit b9f9fed

Please sign in to comment.