Hey y'all! Hopefully a quick question, how do you ...
# multiplatform
j
Hey y'all! Hopefully a quick question, how do you handle dismissing a keyboard on iOS using KMP? On Android, we just press the back button but iOS doesn't have one.
j
you can use keyboardOptions for TextField
Copy code
KeyboardOptions(imeAction = ImeAction.Done)
j
What if you are trying to support multiply lines for a text field?
j
is it related ?
j
j
those are insets
I'm not sure I follow, you asked about hiding the keyboard
j
See the screenshot on that pr, the keyboard is hiding the buttons of the dialog
if you have a textfield that uses the return/new line action vs next. You could have a textfield get big enough to push the buttons behind the keyboard. On Android, we just push the back button to dismiss the keyboard
j
which one ?
j
image.png
j
for "screen" resizing based on insets for a keyboard for example, there is a flag on swift ui level...
Copy code
struct ContentView: View {
    var body: some View {
        ComposeView().ignoresSafeArea(.all) // Compose has own keyboard handler
    }
}
that
ignoresSafeArea
is doing the resizing magic... but what I remember I saw recently some bug related to that
j
I think I'll just wait until that pr fix is push into the next release as it seems to do what I want
j
yeah it might be very well the case... https://github.com/JetBrains/compose-multiplatform/issues?q=ignoresSafeArea+ there is quite few bugs related to it, so it's probably better to wait as you said...
j
Would be nice if iOS just had a back button like android for dismissing keyboard >_<
j
can't agree more... 🙂 but that's probably because I'm 90% android user/dev