NSCollectionView responsive scrolling in 10.13 conflicts with floating elements implemented in NSCollectionViewLayout subclass

Originator:iospiritongt
Number:rdar://33919217 Date Originated:16-Aug.-2017 05:55 PM
Status:Open Resolved:
Product:macOS + SDK Product Version:10.13 beta 6 (17A344b)
Classification:Security Reproducible:Always
 
Summary:
Testing my app against macOS 10.13 beta 6 (17A344b), I discovered that floating elements in NSCollectionViews were greatly lagging behind.

This seems to be caused by NSCollectionView's use of Responsive Scrolling in 10.13 as overriding -prepareContentInRect: does indeed fix the issue. 

My app uses a custom NSCollectionViewLayout subclass that provides support for floating elements beyond just floating headers. The implementation overrides -[NSCollectionViewLayout prepareLayout] to update the layout attributes for the floating items.

Before 10.13, this method is called every time scrolling occurs. In 10.13, it is only called a few times a second, so that the floating elements lag greatly behind and scroll with the content at times they shouldn't do.

The AppKit Release Notes say that overriding -prepareContentInRect: can be used to *experimentally* disable responsive scrolling.

Since I see no way to implement custom floating element support with responsive scrolling turned on, I hope that the ability to turn off responsive scrolling for NSCollectionViews will not go away in future versions as I'd have to essentially write my own NSCollectionView in order to avoid having to rewrite the majority of my app's UI code.


Steps to Reproduce:
1) Scroll NSCollectionView using a custom NSCollectionViewLayout with floating items.

Expected Results:
-[CustomCollectionViewLayout prepareLayout] is called every time a scroll event occurs, so that it can update the layout attributes for the floating items.

Actual Results:
-[CustomCollectionViewLayout prepareLayout] is called only a few times per second, so that the layout attributes can not be updated in time. In consequence, floating items don't stick to their positions and scroll out of view at times they are not supposed to scroll out of view.

Version:
10.13 beta 6 (17A344b)

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!