.sheet and focus elements inside

Hi. I wanted to open a .sheet with .presentationDetents([.height(320)]) and having a couple of pickers and buttons inside.

The problem is that I can't tab with keyboard between the elements inside if I use .presentationDetents([.height(320)]) on the root VStack inside of the .sheet.

It works perfectly if I remove it but then the sheet becomes fullscreen which I don't want.

Is this a bug or am I using it incorrectly?

Yeah, that’s a known issue with custom detents in SwiftUI sheets — keyboard focus navigation often breaks when using fixed heights. For now, you can try using .medium or .large detents instead, or manage focus manually with @FocusState as a workaround.

Okey.

.medium didn't work but .large did, though it's too large sadly. And I can't get @FocusState to work either. Will just skip the sheet for now.

Thanks for the answer!

.sheet and focus elements inside
 
 
Q