Ver Fonte

Update ACarousel.swift

fix bug advance animation when use animation in child View.
link internal animation to specific state variable.
thitran-incepit há 4 anos atrás
pai
commit
c3d14d4813
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      Sources/ACarousel/ACarousel.swift

+ 1 - 1
Sources/ACarousel/ACarousel.swift

@@ -46,7 +46,7 @@ public struct ACarousel<Data, ID, Content> : View where Data : RandomAccessColle
         .frame(width: proxy.size.width, height: proxy.size.height, alignment: .leading)
         .offset(x: viewModel.offset)
         .gesture(viewModel.dragGesture)
-        .animation(viewModel.offsetAnimation)
+        .animation(viewModel.offsetAnimation, value: viewModel.offset)
         .onReceive(timer: viewModel.timer, perform: viewModel.receiveTimer)
         .onReceiveAppLifeCycle(perform: viewModel.setTimerActive)
     }