I found similar problems on SO about the focus engine with SwiftUI on tvOS. I think I managed to solve the focusable issue by wrapping the two Button
s here inside HStack
with focusable.
HStack(spacing: 40) {
Spacer()
CustomButton(
title: Strings.Onboarding.Continue.title,
action: {
handler(selectedProducts.map(\.id))
},
fixedWidth: ProductView.defaultItemSize.width
)
.disabled(selectedProducts.count < 3)
if selectedProducts.count < 3 {
CustomButton(
title: Strings.Onboarding.Skip.title,
action: {
handler([])
},
fixedWidth: ProductView.defaultItemSize.width
)
}
Spacer()
}
.focusable()
But now the Buttons
do not respond to the actions. This is so confusing.
Has anyone solved a similar problem before?