https://kotlinlang.org logo
#compose
Title
# compose
j

julioromano

07/05/2021, 12:34 PM
Software keyboard closes on configuration change I just noticed that when typing in a
BasicTextField
the software keyboard closes whenever there’s a configuration change (rotation, dark mode switch, etc.). I tried fiddling with the
windowSoftInputMode
activity manifest attribute but to no avail. Is this the intended behavior? Is there any way to change it (apart from disallowing any configuration change which is not possible in my case)? PS: The text field also happens to loose focus during the config change.
c

cb

07/05/2021, 2:26 PM
Sounds like a bug. Please raise an issue on the tracker.
g

gitai

07/05/2021, 6:13 PM
IMO, this might actually be reasonable to have… I figure that in Compose (as apposed to Views) only the developer is responsible for handling whats displayed after the device rotates, there is no attempt by the runtime to adjust the UI layout to the new orientation as in the View system. Like, in case of rotation the default behaviour I observed in the Emulator was that the entire screen rotates clockwise (or counter, don’t remember) so I don’t think it make sense to have the keyboard on it’s side when going from portrait to landscape for example. I also think it can be a bit overwhelming if the color of the keyboard suddenly changed to accommodate dark mode, but I don’t know if that what defines the scenario.
4 Views