Re-ordering rows in a UITableView breaks adjustedContentInsets and makes the content jump around

Originator:avedesk
Number:rdar://38796460 Date Originated:23-Mar-2018 05:49 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:11.2.6
Classification:Serious Bug Reproducible:Always
 
Summary:
When reordering rows in a UITableView, when long pressing a row to re-order it, UITableView  internally disables scrolling using setScrollEnabled:, which makes contentInset adjustments being set to (0,0,0,0) when using UIScrollViewContentInsetAdjustmentScrollableAxes / UIScrollViewContentInsetAdjustmentAutomatic. This makes the tableview contents jump around and makes it impossible to autoscroll the dragged row near the edges of the tableview. 


Steps to Reproduce:
1. Have a UITableView inside a UITabbarController and UINavigationController
2. Make sure contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentScrollableAxis
3. Put the tableview into editing mode (-setEditing:YES)
4. Start dragging a row to reorder it

Expected Results:
- adjustedContentInsets stay as is
- scrolling near the edges of not obscured content stays possible

Actual Results:
- adjustedContentInsets is reset to (0, 0, 0, 0)
- tableview contents jumps upwards
- scrolling a dragged row is only possible behind the obscured content (e.g. behind the tab bar)
- scrolling works 

Version:
11.2.6

Notes:
This is caused by UITableView calling `-scrollEnabled:NO` internally when starting to drag a row, which in turns disabled any adjustedContentInsets set automatically by contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentScrollableAxis.

This seems unexpected, because non UIKit code is never calling setScrollEnabled, so one would assume the contentInsets would stay as is.

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!