Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextField/BasicTextField not adding new line on NumPadEnter. #4109

Closed
antontucek opened this issue Jan 9, 2024 · 0 comments · Fixed by JetBrains/compose-multiplatform-core#988
Labels
bug Something isn't working desktop input Touch, mouse, keyboard input related text

Comments

@antontucek
Copy link

antontucek commented Jan 9, 2024

Describe the bug
When using TextField/BasicTextField with singleLine = false, I would expect to add new line on NumPadEnter press, but it doesn't. The behavior is different from when pressing normal enter or Swing JTextArea in general.

Affected platforms

  • Desktop

Versions

  • Kotlin version*: 1.9.20
  • Compose Multiplatform version*: 1.5.11 (also tried on 1.6.0-alpha01, the bug persists)
  • OS version: Windows 11
  • OS architecture: x86
  • JDK (for desktop issues): 17

To Reproduce

  1. Run
fun main() = application {
    Window(onCloseRequest = ::exitApplication) {
        Column {
            Row {
                var textState by remember { mutableStateOf("") }
                TextField(
                    value = textState,
                    onValueChange = { textState = it },
                    modifier = Modifier
                        .padding(start = 4.dp, end = 4.dp)
                        .fillMaxSize(),
                    singleLine = false,
                )
            }
        }
    }
}
  1. Click into TextField.
  2. Press NumPadEnter
  3. See that no new line added.

Expected behavior
A new line added.

@antontucek antontucek added bug Something isn't working submitted labels Jan 9, 2024
@MatkovIvan MatkovIvan added input Touch, mouse, keyboard input related text desktop and removed submitted labels Jan 10, 2024
MatkovIvan added a commit to JetBrains/compose-multiplatform-core that referenced this issue Jan 10, 2024
## Proposed Changes

- Handle `NumPadEnter` as new line in text fields

## Testing

Test: use reproducer from the issue 

## Issues Fixed

Fixes JetBrains/compose-multiplatform#4109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working desktop input Touch, mouse, keyboard input related text
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants