Skip to content

Commit

Permalink
Don't get stuck in programmatic scrolling (#1662)
Browse files Browse the repository at this point in the history
  • Loading branch information
squarejesse authored Nov 1, 2023
1 parent d51f1a6 commit 77f3ee0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ internal open class UIViewLazyList(
scrollProcessor.onUserScroll(firstIndex, lastIndex)
}

/**
* If the user begins a drag while we’re programmatically scrolling, well then we're not
* programmatically scrolling anymore.
*/
override fun scrollViewWillBeginDragging(scrollView: UIScrollView) {
isDoingProgrammaticScroll = false
}

override fun scrollViewDidEndScrollingAnimation(scrollView: UIScrollView) {
isDoingProgrammaticScroll = false
}
Expand All @@ -169,7 +177,6 @@ internal open class UIViewLazyList(
tableView.apply {
dataSource = this@UIViewLazyList.dataSource
delegate = tableViewDelegate
prefetchingEnabled = true
rowHeight = UITableViewAutomaticDimension
separatorStyle = UITableViewCellSeparatorStyleNone

Expand Down
2 changes: 2 additions & 0 deletions samples/emoji-search/ios-uikit/EmojiSearchApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
Expand Down
2 changes: 2 additions & 0 deletions test-app/ios-uikit/TestApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
Expand Down

0 comments on commit 77f3ee0

Please sign in to comment.