Skip to content

Commit

Permalink
AdaptyUI: use index as id in ForEach
Browse files Browse the repository at this point in the history
  • Loading branch information
x401om committed Dec 4, 2024
1 parent ea77b95 commit 61a7f31
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions AdaptyUI/Rendering/Elements/AdaptyUIStackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ struct AdaptyUIStackView: View {
VStack(alignment: stack.horizontalAlignment.swiftuiValue(with: layoutDirection),
spacing: stack.spacing)
{
ForEach(stack.content, id: \.self) {
AdaptyUIElementView($0)
ForEach(0 ..< stack.content.count, id: \.self) {
AdaptyUIElementView(stack.content[$0])
}


}
case .horizontal:
HStack(alignment: stack.verticalAlignment.swiftuiValue, spacing: stack.spacing) {
ForEach(stack.content, id: \.self) {
AdaptyUIElementView($0)
ForEach(0 ..< stack.content.count, id: \.self) {
AdaptyUIElementView(stack.content[$0])
}
}
case .z:
Expand All @@ -46,8 +44,8 @@ struct AdaptyUIStackView: View {
vertical: stack.verticalAlignment.swiftuiValue
)
) {
ForEach(stack.content, id: \.self) {
AdaptyUIElementView($0)
ForEach(0 ..< stack.content.count, id: \.self) {
AdaptyUIElementView(stack.content[$0])
}
}
}
Expand Down

0 comments on commit 61a7f31

Please sign in to comment.