Skip to content

Commit 2c632ed

Browse files
committed
Fix for View moves downwards when applying basic shimmer #14
1 parent 1f3a620 commit 2c632ed

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Sources/Shimmer/Shimmer.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,9 @@ public struct Shimmer: ViewModifier {
8383
public func body(content: Content) -> some View {
8484
content
8585
.mask(LinearGradient(gradient: gradient, startPoint: startPoint, endPoint: endPoint))
86+
.animation(animation, value: isInitialState)
8687
.onAppear {
87-
withAnimation(animation) {
88-
isInitialState = false
89-
}
88+
isInitialState = false
9089
}
9190
}
9291
}

0 commit comments

Comments
 (0)