.focusEffectDisabled(true) not working

Hi everyone,

I'm working on a tvOS app using SwiftUI, and I want to disable the focus effect (the default focus glow/bounce) on a specific Button. According to the documentation:

/// - Parameter disabled: A Boolean value that determines whether this view /// can display focus effects. /// - Returns: A view that controls whether focus effects can be displayed /// in this view.

I used .focusEffectDisabled(true) on the Button, expecting the focus style to be completely disabled for that view. However, this doesn’t seem to have any effect in my tvOS 17+ app – the button still shows the default focus visual effect when focused.

Here’s a simplified example:

Button("Click Me") { // action } .focusEffectDisabled(true)

This still shows the bounce/glow focus effect. Am I missing something, or is this a bug?

Has anyone managed to fully disable the focus effect for a view (especially Button) in tvOS using SwiftUI? Any workarounds or additional modifiers I should apply?

Thanks in advance!

@PrashantGaikwad To do this, you'll would need to create a custom ButtonStyle and define the interaction behaviors you want.

Ok, thanks for taking the time to respond to my question.

But then what is the use of .focusEffectDisabled(true) modifier because the below code which is from Apple documentation is also not removing the focus effect.

HStack { Button("Press") {} .focusEffectDisabled(false) } .focusEffectDisabled(true)

Above Button is always getting the default focus effect.

.focusEffectDisabled(true) not working
 
 
Q