VisionOS: .hoverEffect { effect.scaleEffect } breaking .draggable

When I define a .hoverEffect {} like below, the .draggable() functionality stops working:

        Image(“MyImage”)
            .resizable()
            .frame(width: 150, height: 150)
            .aspectRatio(contentMode: .fit)
            .padding(5)
            .draggable("foo")
            .hoverEffect { effect, isActive, proxy in  
                effect.scaleEffect(!isActive ? 1.0 : 1.1)  // <— breaks draggable() 
            }

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

I have filed a feedback. Meanwhile, does anyone have a workaround for this? I would really much like to have a hover scale effect for my draggable view.

And for example, .hoverEffect(.highlight) does not break .draggable().

Oh and this is in a RealityView attachment view, not a window.

Hi @matti777 ,

Thanks so much for filling that bug report. It definitely does look like buggy behavior. Keep an eye on that feedback site for updates to it, as there's no workaround for this. It does seem like effect.opacity would work, but not the scale effect/offset.

Best,

Sydney

VisionOS: .hoverEffect { effect.scaleEffect } breaking .draggable
 
 
Q