You should use this overload where the behaviour is implemented by default.
BasicTextField( state = rememberTextFieldState(), lineLimits = TextFieldLineLimits.SingleLine, )
Works for all TextField composables.