SwiftUI Buttons and onMoveCommand Missing Presses

In tvOS 18 the onMoveCommand is missing the first press after a view is loaded and every time the direction is changed. It also misses the first press on a button after a focus change. This appears to only impact the newer silver remote and not the older black remote or IR remotes.

With the code bellow press any direction 3 times and it will only log twice.

struct ButtonTest: View {
    var body: some View {
        VStack {
            Button {
                debugPrint("button 1")
            } label: {
                Text("Button 1")
            }
            Button {
                debugPrint("button 2")
            } label: {
                Text("Button 2")
            }

            Button {
                debugPrint("button 3")
            } label: {
                Text("Button 3")
            }

        }
        .onMoveCommand(perform: { direction in
            debugPrint("move \(direction)")
        })
        .padding()
    }
}
Answered by DTS Engineer in 805737022

The engineering teams would need to investigate this issue. I'd appreciate it if you could open a bug report, include the code and steps to reproduce the issue and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

The engineering teams would need to investigate this issue. I'd appreciate it if you could open a bug report, include the code and steps to reproduce the issue and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

I submitted a bug report (FB15272007) and requested code level support from the developer portal.

UIButtons do not appear to be impacted as well as pressesBegan but pressesEnded is inconsistent but not in a predictable way. It seems to be randomly missing presses.

SwiftUI Buttons and onMoveCommand Missing Presses
 
 
Q