Open skunkworker opened 4 years ago
This issue appears to be very odd. I am logging each of the cells with their number every time they appear and disappear. Sometimes the sheet can be presented without the cells disappearing, but the cells that disappear and reappear when the keyboard is brought up always show the issue.
Other times those same cells are never disappeared/appeared and the issue does not show up.
I got around this bug by changing the itemSize to absolute instead of estimated. I think this may be because the estimated size changes for the cells that are being blocked by the keyboard. It's hackish but it works.
return ASCollectionLayoutSection
{
let itemSize = NSCollectionLayoutSize(
widthDimension: .fractionalWidth(1.0),
heightDimension: .absolute(60))
let item = NSCollectionLayoutItem(layoutSize: itemSize)
I think this might have to do with SwiftUI's new keyboard avoidance behaviour. I am curious if this still happens when using the v1.8.0
branch? Otherwise, it seems that the cells' frames are being set within an animation block, which is odd given this is managed by UICollectionView outside of our control.
@apptekstudios I just tested this on v1.8.0WIP
and I'm still seeing the original behavior.
Describe the bug When a ASCollectionView is wrapped inside of a NavigationView and you present a Sheet View with an editable field. If you are focused on the editable field and then dismiss the view, which dismisses the keyboard, the last few items are being "reloaded" with an animation from the left.
To Reproduce This small test app reproduces this bug. https://github.com/skunkworker/ascollection-view-bug-testapp Click the "+" at the top, then click "Close" or "Save"
Expected behaviour The sheet should be dismissed without any of the cell items refreshing.
Screenshots
The animation shows that the last cell loads in when it should be fully loaded at this stage of the keyboard dismissal.
Video included in bug reproduction repository above.
Xcode Version:
Simulator, Device, Both?