VisionOS: .hoverEffect { effect.scaleEffect } breaking .fill()

A problem similar to https://developer.apple.com/forums/thread/761211 posted by @matti777. I was trying to implement the interaction of draggable point. When some point is activated, the color would change accordingly. When I define a .hoverEffect {} like below, the change of color in .fill() functionality stops working:

struct DraggableCircleView: View {
    @Binding var position: CGPoint
    @Binding var activeIndex: Int
    var currentIndex: Int
    var radius:CGFloat = 20
    var body: some View {
        Circle()
            .fill(activeIndex == currentIndex ? Color.blue : Color.white.opacity(0.1))
            .frame(width: radius, height: radius)
            .hoverEffect(.highlight)
// the issue occurred when the code below added:
//          .hoverEffect { effect, isactive, _ in
//              effect.scaleEffect(isactive ? 1.5 : 0.8)
//          }
            .position(position)
            .gesture(
                DragGesture()
                    .onChanged { value in
                        self.position = value.location
                        activeIndex = currentIndex
                    }
            )
            .gesture(
                TapGesture()
                .onEnded({
                    activeIndex = currentIndex
                })
            )
            .transition(.opacity)
            .animation(.easeInOut, value: activeIndex)
    }
}

Occurring on VisionOS 2.0 Beta 4 SDK, Xcode 16 Beta 4.

Does anyone have a workaround for this? I would really much like to have a hover scale effect for my draggable point. In addition, .hoverEffect(.highlight) does not break changes of fill color.

Anyone interest in my full code can contact me and ask for it due to the post length limit.

Hi @AnranChen ,

Can you please file a bug report at https://feedbackassistant.apple.com and post the FB number here? Please add the full code! I'm unable to reproduce the issue but I'm not certain that I'm using the same values for the bindings as you.

Thanks, Sydney

hi @Vision Pro Engineer, I have submitted a feedback: FB14807195 I would be grateful if the issue could be fixed.

VisionOS: .hoverEffect { effect.scaleEffect } breaking .fill()
 
 
Q