[SwiftUI] ScrollView update improperly renders content disregarding indicators

Originator:flavio
Number:rdar://9038728 Date Originated:2021-03-10
Status:Closed Resolved:Yes
Product:SwiftUI Product Version:-
Classification:Incorrect/Unexpected Behavior Reproducible:Yes
 
When updating the content of a ScrollView, if the new content requires the indicators to be visible (i.e. expanding the content size) the content will be improperly rendered with the full ScrollView width disregarding the ScrollView's indicators which will cover some of the content.

A workaround is manually forcing the ScrollView to be re-updated either by changing a state or an observed object.

Steps to reproduce:
1. Open the attached project
2. The view takes 1 second to update and render a list inside the ScrollView
3. Notice the border that wraps each element. The trailing size is hidden behind the ScrollView indicators
4. Manually resizing the window trigger an update that fixes the content size.

Expected behavior:
The content should be rendered with a padding that takes into account the width of the indicators.

Actual behavior:
Currently, the content is rendered with the full ScrollView size and partially hidden by the indicator. Any updates that trigger re-rendering the ScrollView content will resize the content fixing the issue.

Comments

Example

Check https://github.com/fjcaetano/not-awesome-swiftui

Reporter

The issue is not reproducible anymore. Thank you!

Apple

We are not able to reproduce the issue on the latest. We tried having the scroll bars visible always in the system preferences too.

Please verify this issue with macOS Monterey 12 Beta 7 and update your bug report with your results by logging into https://feedbackassistant.apple.com/ or by using the Feedback Assistant app.

macOS Monterey 12 Beta 7 (21A5522h) https://developer.apple.com/download/ Posted Date: Sept 21st, 2021

If the issue persists, please let us know.


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!