Hello,
I have noticed weird behaviour of List on iOS 17 when \.layoutDirection is changed. It appears that frame of child views in List is wrongly updated. Below I include code and screenshots representing the problem.
Example code:
struct ContentView: View {
@State private var isRTL = false
var body: some View {
Toggle("RTL", isOn: $isRTL)
List {
ForEach(0...5, id: \.self) { index in
Section(header: Text("Section \(index)")) {
Text("Row 0")
Text("Row 1")
}
}
}
.listStyle(.grouped)
.environment(\.layoutDirection, isRTL ? .rightToLeft : .leftToRight)
Spacer()
}
}
\.layoutDirection is .leftToRight
\.layoutDirection is .rightToLeft
\.layoutDirection is .leftToRight
\.layoutDirection is .rightToLeft